Learning A Universal Crime Predictor with Knowledge-guided Hypernetworks

Fidan Karimova, Tong Chen, Yu Yang, Shazia SadiqarXiv 2025 · DOI · OpenReview

Abstract

Predicting crimes in urban environments is crucial for public safety, yet existing prediction methods often struggle to align the knowledge across diverse cities that vary dramatically in data availability of specific crime types. We propose HYpernetwork-enhanced Spatial Temporal Learning (HYSTL), a framework that can effectively train a unified, stronger crime predictor without assuming identical crime types in different cities' records. In HYSTL, instead of parameterising a dedicated predictor per crime type, a hypernetwork is designed to dynamically generate parameters for the prediction function conditioned on the crime type of interest. To bridge the semantic gap between different crime types, a structured crime knowledge graph is built, where the learned representations of crimes are used as the input to the hypernetwork to facilitate parameter generation. As such, when making predictions for each crime type, the predictor is additionally guided by its intricate association with other relevant crime types. Extensive experiments are performed on two cities with non-overlapping crime types, and the results demonstrate HYSTL outperforms state-of-the-art baselines.

Introduction

Crime prediction is a cornerstone of modern urban planning and public safety. However, the field faces a significant "city-specific" bottleneck. Most predictive models are trained on data from a single jurisdiction and fail to generalize when applied elsewhere. This lack of portability stems from two primary issues: semantic misalignment, where different cities use different terminology for similar offenses (e.g., "Larceny" vs. "Theft"), and heterogeneous dynamics, where different types of crime exhibit unique spatial and temporal patterns.

To address these challenges, we introduce HYSTL (HYpernetwork-enhanced Spatial Temporal Learning). HYSTL moves away from static, city-specific models toward a universal framework that leverages a global Crime Knowledge Graph and dynamic parameter generation to predict crime across diverse urban environments.

The HYSTL Framework

1. Crime Knowledge Graph (CrimeKG)

To bridge the semantic gap between jurisdictions, we constructed a domain-specific Knowledge Graph using the Wikimedia REST API. This CrimeKG contains over 3,000 nodes—including crime types, legal codes, and associated objects like weapons—and 5,000 edges. By embedding these relationships, the model can automatically identify similarities between crime categories across different cities without the need for manual, labor-intensive mapping.

2. Hypernetworks for Dynamic Parameter Generation

The core innovation of HYSTL is the use of a hypernetwork to generate model parameters. In traditional architectures, model weights are fixed after training. In HYSTL, a secondary multilayer perceptron (the hypernetwork) takes a crime's embedding from the CrimeKG as input and dynamically generates the specific weights and biases for the primary prediction model, an A3TGCN (Attention Temporal Graph Convolutional Network). This allows the model to adapt its predictive logic based on the specific nature of the crime being analyzed.

3. Attention-based Temporal Aggregation

To capture the complex temporal patterns of urban crime, HYSTL employs an attention mechanism. This component weighs the importance of historical time steps, allowing the model to prioritize the most relevant past events when forecasting future crime occurrences.

Experimental Evaluation

Datasets

We evaluated HYSTL using two years of real-world data from two major U.S. cities:

  • New York City (2014–2015): Focusing on Burglary, Robbery, Assault, and Larceny.
  • Chicago (2016–2017): Focusing on Theft, Battery, Damage, and Assault.

These cities feature largely non-overlapping crime categories, providing a rigorous environment to test the model's ability to generalize across different label spaces.

Performance Results

HYSTL was benchmarked against 12 state-of-the-art baselines, including UrbanGPT and STHSL. The results demonstrated significant improvements across several metrics:

  • Accuracy: HYSTL consistently achieved the lowest Mean Absolute Error (MAE) and Mean Absolute Percentage Error (MAPE) for all crime types in both NYC and Chicago.
  • Violent Crime Prediction: The model was particularly effective at predicting violent crimes like Robbery and Assault, showing an MAE reduction of 15–20% compared to existing baselines.
  • Cross-City Robustness: Unlike baseline models that often degrade when moved between urban contexts, HYSTL maintained consistent performance, validating its utility as a universal predictor.

Discussion and Future Work

HYSTL demonstrates that knowledge-guided hypernetworks can effectively manage the semantic and dynamic heterogeneity of urban crime data. By using a Knowledge Graph as an "active controller," the model facilitates efficient knowledge transfer and scalability, as a single hypernetwork can handle numerous crime categories without requiring separate models for each.

Future research will focus on improving the interpretability of the hypernetwork's parameter generation process and extending the framework to "cold-start" scenarios, where a city may have very little historical data for a specific or emerging crime type. Additionally, we aim to adapt HYSTL for real-time law enforcement decision-support systems to enhance proactive public safety measures.

Summary updated

BibTeX
@misc{karimova2025learning,
  author = {Fidan Karimova and Tong Chen and Yu Yang and Shazia Sadiq},
  title = {{Learning A Universal Crime Predictor with Knowledge-guided Hypernetworks}},
  year = {2025},
  eprint = {2511.02336},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.02336},
}
Figure