Urban crime spatial-temporal distribution prediction method, device and system, and storage medium

By obtaining and processing historical crime and taxi flow data, extracting community characteristics and building a crime spatio-temporal distribution prediction model, the problem that existing methods fail to fully consider the impact of population mobility and taxi flow fluctuations on crime prediction is achieved, and more High-precision crime spatiotemporal distribution prediction.

CN119515641APending Publication Date: 2025-02-25LANZHOU JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411619426.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing crime space-time prediction methods fail to fully consider the impact of inter-regional population mobility links and taxi flow fluctuations on the number of criminal cases within the space-time unit reflected by taxi flow.

Method used

By obtaining historical crime data and historical taxi flow data, community zoning is used as the minimum space unit to perform division mapping and smooth noise reduction processing, extract community taxi flow characteristics, near-neighbor trend characteristics and long-term trend characteristics of crime, and build crime space-time and space Distribution prediction model, using the spatiotemporal feature extraction module and the spatiotemporal feature channel attention module for effective fusion of multi-feature data.

Benefits of technology

By taking into account the nearest neighbor trend characteristics, long-term trend characteristics and taxi flow characteristics of crime data at the same time, it can more accurately capture the mutual influence of crime in space and improve the accuracy of crime spatiotemporal distribution prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515641A_ABST
    Figure CN119515641A_ABST
Patent Text Reader

Abstract

The invention discloses an urban crime time-space distribution prediction method, device and system, and a storage medium. The method comprises the following steps: S1, obtaining historical crime data and historical taxi stream data; s2, according to the historical crime data and the historical taxi stream data, obtaining community taxi stream features, crime neighbor trend features and long-term trend features; s3, obtaining a crime space-time distribution prediction model according to the community taxi stream features, the crime neighbor trend features and long-term trend features and the association relationship between communities; and S4, inputting real-time taxi stream data into the crime time-space distribution prediction model to obtain an urban crime time-space distribution result. By adopting the technical scheme of the invention, accurate prediction of urban crimes can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of machine learning, and in particular relates to a method and device, a system, and a storage medium for predicting the spatiotemporal distribution of urban crime. Background Art

[0002] The complex production and living environment and a large number of floating population in cities are prone to crime. Since crime seriously affects social stability and prosperity, it has become one of the key public issues in urban development. With the development and application of technologies such as big data and computers, the current focus of policing has changed from passively responding to crime to actively preventing the occurrence of crime, that is, data-driven predictive policing. Crime spatiotemporal prediction predicts the distribution of crime at a specific time and space in the future through historical crime data and other characteristic data. It is one of the most representative predictive policing. The prediction results can be used for the deployment of police forces, thereby preventing the occurrence of criminal behavior in advance and reducing the urban crime rate.

[0003] Crime does not occur randomly, and there are many factors that affect crime. According to the characteristic data used in crime prediction, existing crime prediction research can be divided into three categories: time series feature prediction, static spatiotemporal feature prediction, and dynamic spatiotemporal feature prediction. At present, based on the near-repetition theory, the focus is on analyzing and modeling the time series characteristics of regional historical crime cases. For example, Wang et al. regarded the inter-regional taxi flow data as a spatial association for predicting the transmission of crime between units, and added it to the improved regression model. Compared with the urban crime rate calculated using traditional features, the prediction accuracy is significantly improved. However, the inter-regional population mobility connection reflected by the taxi flow and the impact of taxi flow fluctuations on the number of crime cases within the spatiotemporal unit are not considered at the same time. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and device, a system and a storage medium for predicting the spatiotemporal distribution of urban crimes.

[0005] To achieve the above object, the present invention adopts the following technical solution:

[0006] A method for predicting the spatiotemporal distribution of urban crime, comprising:

[0007] Step S1, obtaining historical crime data and historical taxi flow data;

[0008] Step S2: Based on the historical crime data and the historical taxi flow data, the Tianhe community division is used as the minimum space-time unit for division mapping and smoothing noise reduction processing to obtain the community taxi flow characteristics, the neighborhood trend characteristics and the long-term trend characteristics of the crime;

[0009] Step S3, according to the characteristics of community taxi flow, the neighborhood trend characteristics and long-term trend characteristics of crime, and the correlation between communities, a crime spatiotemporal distribution prediction model is obtained; wherein, the spatial topology between communities, POI distribution and traffic flow between communities are used to jointly express the correlation between communities; the crime spatiotemporal distribution prediction model includes: a spatiotemporal feature extraction module and a spatiotemporal feature channel attention module, the spatiotemporal feature extraction module is used to extract the spatiotemporal dependency of community taxi flow characteristics, the neighborhood trend characteristics and long-term trend characteristics of crime, and the spatiotemporal feature channel attention module is used to aggregate the channel attention and spatial attention results to obtain enhanced features.

[0010] Step S4: input the real-time taxi flow data into the crime spatiotemporal distribution prediction model to obtain the urban crime spatiotemporal distribution results.

[0011] The present invention also provides a device for predicting the spatiotemporal distribution of urban crime, comprising:

[0012] The acquisition module is used to obtain historical crime data and historical taxi flow data;

[0013] A processing module is used to perform partition mapping and smooth noise reduction processing based on historical crime data and historical taxi flow data, taking Tianhe community division as the minimum spatiotemporal unit, to obtain community taxi flow characteristics, neighborhood trend characteristics and long-term trend characteristics of crimes;

[0014] A training module is used to obtain a crime spatiotemporal distribution prediction model based on community taxi flow characteristics, crime neighborhood trend characteristics and long-term trend characteristics, and inter-community correlation relationships; wherein the inter-community correlation relationships are jointly expressed by inter-community spatial topology, POI distribution, and inter-community traffic flow; the crime spatiotemporal distribution prediction model includes: a spatiotemporal feature extraction module and a spatiotemporal feature channel attention module, the spatiotemporal feature extraction module is used to extract the spatiotemporal dependency of community taxi flow characteristics, crime neighborhood trend characteristics, and long-term trend characteristics, and the spatiotemporal feature channel attention module is used to aggregate channel attention and spatial attention results to obtain enhanced features;

[0015] The prediction module is used to input the real-time taxi flow data into the crime spatiotemporal distribution prediction model to obtain the spatiotemporal distribution results of urban crime.

[0016] An embodiment of the present invention also provides a system for predicting the spatiotemporal distribution of urban crime, comprising: a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program executes a method for predicting the spatiotemporal distribution of urban crime when executed by the processor.

[0017] An embodiment of the present invention further provides a storage medium, on which a computer program is stored, and when the computer program is run, the method for predicting the spatiotemporal distribution of urban crime is executed.

[0018] The present invention simultaneously considers the neighborhood trend characteristics, long-term trend characteristics and taxi flow characteristics of crime data, and jointly inputs them into the crime spatiotemporal distribution prediction model to extract spatiotemporal dependencies, and realizes the effective fusion of multi-feature data through improved spatiotemporal feature channel attention; at the same time, POI distribution and taxi flow between communities are used to jointly represent the correlation between communities, thereby more comprehensively capturing the spatial mutual influence of crime. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0020] Figure 1 This is a flow chart of a method for predicting the spatiotemporal distribution of urban crime according to an embodiment of the present invention;

[0021] Figure 2 It is a schematic diagram of the CDSPM model structure;

[0022] Figure 3 This is a schematic diagram of the GRU model structure;

[0023] Figure 4 Channel attention (top) and spatial attention (bottom). DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] Embodiment 1:

[0027] like Figure 1 As shown, the present invention provides a method for predicting the spatiotemporal distribution of urban crime, comprising:

[0028] Step S1, obtaining historical crime data and historical taxi flow data;

[0029] Step S2: Obtain community taxi flow characteristics, neighborhood trend characteristics, and long-term trend characteristics of crimes based on historical crime data and historical taxi flow data;

[0030] Step S3, obtaining a crime spatiotemporal distribution prediction model based on community taxi flow characteristics, neighborhood trend characteristics and long-term trend characteristics of crime, and inter-community correlation relationships;

[0031] Step S4: input the real-time taxi flow data into the crime spatiotemporal distribution prediction model to obtain the urban crime spatiotemporal distribution results.

[0032] As an implementation method of the present invention, in step S2, based on historical crime data and historical taxi flow data, the Tianhe community division is used as the minimum spatiotemporal unit for division mapping and smoothing noise reduction processing to obtain community taxi flow characteristics, neighborhood trend characteristics of crimes, and long-term trend characteristics; specifically:

[0033] Taking the day as the minimum time unit and the community division as the minimum spatial unit, the historical crime data is divided and mapped to obtain the number of daily crime cases in each community. In order to solve the problems of data sparseness and prominent outliers after division, the exponential moving average (EMA) method is used for smoothing. EMA is a common smoothing method for time series data. It uses exponentially decreasing weighted moving average. The weighted influence of each value decreases exponentially according to the neighboring relationship, thereby controlling the influence of historical data on the data at the next moment. The calculation formula is:

[0034] EMA t =α×Y t +(1-α)×EMA t-1

[0035] Among them, EMA t is the smoothed value at time t, Y t is the observed value at time t, EMA t-1 is the smoothing value of the previous moment, α is the smoothing parameter, and its value range is 0 to 1.

[0036] According to the historical taxi flow data, the spatial and temporal scale consistent with the historical crime data is used to divide and map the community taxi flow characteristics (i.e., taxi OD data). The community taxi flow characteristics include: taxi flow within the community and taxi flow between communities. The data is summarized and counted according to the date, starting point, and end point of the taxi OD data. The daily community taxi flow is defined as Among them, o is the number of the starting community, d is the number of the destination community, n is the maximum community number, and t represents the tth day. Then summarize the community taxi flow of all dates Where m is the total number of days of experimental data.

[0037] As an implementation of the embodiment of the present invention, step S3 includes:

[0038] Step S31, constructing the association relationship between communities through the spatial topology between communities, POI distribution and traffic flow between communities;

[0039] Step S32: Obtain a crime spatiotemporal distribution prediction model based on the community taxi flow characteristics, the neighborhood trend characteristics and long-term trend characteristics of crime, and the correlation between communities.

[0040] Furthermore, in step S31, a graph G = (V, E) is defined to describe the graph structure between communities, where V = (v1, v2, ... v n ) is the node set of the community, n is the maximum community number; E represents the edge set of the association relationship between communities. The topological relationship between communities is represented as the adjacency matrix A; the number of POIs of each type in each community is counted, and the cosine similarity between communities is calculated according to the community distribution of different types of POIs, and the community POI similarity matrix P is generated based on the calculation results; the community traffic relationship matrix L is constructed by summarizing and normalizing the taxi flow between communities, A, P, L∈R N*N The above three community relationship matrices are given the same weights and weighted averaged to obtain a new weighted matrix A representing community relationships: w , the formula is as follows:

[0041]

[0042] Further, in step S32, a crime feature matrix X is constructed based on the historical crime data and the historical taxi flow data. c and the taxi flow feature matrix X f , X c , X f ∈R N*M , N is the number of community nodes, M represents the length of node feature attributes, that is, the historical time series length of the feature. For the crime prediction date t, the neighbor trend feature x s =[X c t-1-w :X c t-1 ]; Long-term trend characteristics x l =[X c t-T-w :X c t-T ]; Community traffic characteristics x f =[X f t-1-w :X f t-1], where w represents the prediction time window, which is set to one week (7 days) according to the population regularity cycle; T represents the long-term interval, which is set to one year (365 days). The three types of features extracted are embedded in the weighted matrix A respectively. w The graph structure represented by is used as the input data for training the crime spatiotemporal distribution prediction model CDSPM. The crime spatiotemporal distribution prediction model includes: multiple spatiotemporal feature extraction modules and spatiotemporal feature channel attention modules. The spatiotemporal feature extraction module is used to extract the spatiotemporal dependency of community taxi flow characteristics, crime neighbor trend characteristics and long-term trend characteristics. The spatiotemporal feature channel attention module is used to aggregate the channel attention and spatial attention results to obtain enhanced features, such as Figure 2 shown.

[0043] Furthermore, the spatiotemporal feature extraction module includes: a graph convolutional neural network and a gated recurrent unit.

[0044] Graph Convolutional Network (GCN) is a convolution operation for topological data structures, which can be seen as an extension of Convolutional Neural Network (CNN) in non-Euclidean space. For each node, GCN can capture the spatial characteristics of nodes in its first-order neighborhood and adjust the convolution field of view by controlling the network depth. In order to enable GCN to better capture the correlation between communities with a limited number of network layers, a weighted matrix A representing the deeper relationship between communities is used. w Input network, the calculation formula is as follows:

[0045]

[0046] Among them, X represents the input feature matrix, A w is the weighting matrix, I N is the identity matrix, is the degree matrix, ReLU is the activation function, W and b are the weights and bias parameters of the network. This paper uses two layers of GCN to extract spatial features from the input data:

[0047]

[0048] in, W0 and W1 are weights to be learned.

[0049] The Gated Recurrent Unit (GRU) is an improved version of the Recurrent Neural Network (RNN). It aims to solve the problems of gradient vanishing and gradient exploding when RNN processes long sequence data, and improve the model's ability to remember long-term information. GRU mainly controls the update and transmission of information through its gating mechanism, such as Figure 3 shown.

[0050] Select GRU as the temporal feature extraction layer of the model, and the calculation formula is as follows:

[0051]

[0052] Among them, h t-1 represents the hidden state at time t-1; X t represents the input features at time t; z t is the update gate, which is used to control the degree to which the state information of the previous moment enters the current state; r t is the reset gate, which is used to control the degree of ignoring the state information of the previous moment; is the candidate hidden state at time t; h t is the output at time t. GRU calculates the output at the current moment through the hidden state at the previous moment and the input features at the current moment, taking into account the time correlation of the current feature information and the historical feature information.

[0053] Furthermore, the spatiotemporal feature channel attention module CBAM (Convolutional Block Attention Module) is an attention module used to enhance the local feature expression of the network in the channel and spatial dimensions and thus improve the overall performance of the network. Its core idea is to perform two pooling operations on the features in the channel and spatial dimensions respectively, calculate and learn important features, such as Figure 4 As shown, the channel attention and spatial attention results are finally aggregated to obtain enhanced features.

[0054] The embodiment of the present invention is improved on the basis of CBAM. First, feature channel attention is added to aggregate the three types of features at each moment, and then the new features are successively input into the temporal channel attention and spatial attention, focusing on the effective parts of the features in time and space respectively and enhancing them, and the final enhanced features are obtained, such as Figure 4 The improved spatiotemporal feature channel attention module is learned and enhanced according to the output order of the spatiotemporal feature extraction layer, and makes full use of the hidden state of multiple features at each moment, which can achieve better attention enhancement results. The formula is as follows:

[0055]

[0056] Among them, M c (F) is the channel attention, M s (F) is spatial attention, M(F) is the improved spatiotemporal feature channel attention, σ is the activation function, Indicates the multiplication of corresponding elements, AvgPool and MaxPool are average pooling and maximum pooling respectively, MLP is the fully connected layer, and Conv is the convolution operation.

[0057] In summary, if Figure 2 As shown in the figure, the CDSPM model consists of multiple spatiotemporal feature extraction modules and a spatiotemporal feature channel attention module. The spatiotemporal feature extraction module contains GCN layers and GRU layers, which are used to cyclically extract the spatial and temporal dependencies of the input data. Three spatiotemporal feature extraction modules are arranged in parallel in the CDSPM model to extract neighbor trend features, long-term trend features, and traffic flow features, respectively. The feature matrix processed by the spatiotemporal feature extraction module is spliced ​​in the temporal dimension to form the input features of the spatiotemporal feature channel attention module. The feature channel attention is first used to enhance and fuse the three feature matrices at each moment; then the temporal channel attention and spatial attention are used to enhance the effective information in the spatiotemporal dimension respectively; finally, the feature matrix enhanced with feature information and spatiotemporal information is input into the fully connected layer to output the final crime prediction result. In addition, in order to reduce the operation parameters and avoid model overfitting, a Dropout layer is added before the two fully connected layers of the CDSPM model.

[0058] The loss function for CDSPM model training is SmoothL1. Compared with the mean squared error (MSE) loss function, SmoothL1 pays more attention to values ​​within the normal range and has a smaller penalty for outliers and abnormal values, making the overall training process smoother. The calculation formula of SmoothL1 is as follows:

[0059]

[0060] Among them, y is the predicted value, is the true value, and SmoothL1 is divided according to the absolute error between the predicted value and the true value: when the absolute error is less than 1, the square error is used; when the absolute error is greater than or equal to 1, the linear error is used.

[0061] Embodiment 2:

[0062] The embodiment of the present invention further provides a device for predicting the spatiotemporal distribution of urban crime, comprising:

[0063] The acquisition module is used to obtain historical crime data and historical taxi flow data;

[0064] A processing module is used to perform partition mapping and smooth noise reduction processing based on historical crime data and historical taxi flow data, taking Tianhe community division as the minimum spatiotemporal unit, to obtain community taxi flow characteristics, neighborhood trend characteristics and long-term trend characteristics of crimes;

[0065] A training module is used to obtain a crime spatiotemporal distribution prediction model based on community taxi flow characteristics, crime neighborhood trend characteristics and long-term trend characteristics, and inter-community correlation relationships; wherein the inter-community correlation relationships are jointly expressed by inter-community spatial topology, POI distribution, and inter-community traffic flow; the crime spatiotemporal distribution prediction model includes: a spatiotemporal feature extraction module and a spatiotemporal feature channel attention module, the spatiotemporal feature extraction module is used to extract the spatiotemporal dependency of community taxi flow characteristics, crime neighborhood trend characteristics, and long-term trend characteristics, and the spatiotemporal feature channel attention module is used to aggregate channel attention and spatial attention results to obtain enhanced features;

[0066] The prediction module is used to input the real-time taxi flow data into the crime spatiotemporal distribution prediction model to obtain the spatiotemporal distribution results of urban crime.

[0067] Embodiment 3:

[0068] An embodiment of the present invention also provides a system for predicting the spatiotemporal distribution of urban crime, comprising: a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program executes a method for predicting the spatiotemporal distribution of urban crime when executed by the processor.

[0069] Embodiment 4:

[0070] An embodiment of the present invention further provides a storage medium, on which a computer program is stored, and when the computer program is run, the method for predicting the spatiotemporal distribution of urban crime is executed.

[0071] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A method for predicting the spatiotemporal distribution of urban crime, characterized in that: include: Step S1, obtaining historical crime data and historical taxi flow data; Step S2: Based on the historical crime data and the historical taxi flow data, the Tianhe community division is used as the minimum space-time unit for division mapping and smoothing noise reduction processing to obtain the community taxi flow characteristics, the neighborhood trend characteristics and the long-term trend characteristics of the crime; Step S3, according to the characteristics of community taxi flow, the neighborhood trend characteristics and long-term trend characteristics of crime, and the correlation between communities, a crime spatiotemporal distribution prediction model is obtained; wherein, the inter-community correlation relationship is jointly expressed by the inter-community spatial topology, POI distribution and inter-community traffic flow; the crime spatiotemporal distribution prediction model includes: a spatiotemporal feature extraction module and a spatiotemporal feature channel attention module, the spatiotemporal feature extraction module is used to extract the spatiotemporal dependency of the community taxi flow characteristics, the neighborhood trend characteristics and long-term trend characteristics of the crime, and the spatiotemporal feature channel attention module is used to aggregate the channel attention and spatial attention results to obtain enhanced features; Step S4: input the real-time taxi flow data into the crime spatiotemporal distribution prediction model to obtain the urban crime spatiotemporal distribution results.

2. A device for predicting the spatiotemporal distribution of urban crime, characterized in that: include: The acquisition module is used to obtain historical crime data and historical taxi flow data; A processing module is used to perform partition mapping and smooth noise reduction processing based on historical crime data and historical taxi flow data, taking Tianhe community division as the minimum spatiotemporal unit, to obtain community taxi flow characteristics, neighborhood trend characteristics and long-term trend characteristics of crimes; A training module is used to obtain a crime spatiotemporal distribution prediction model based on community taxi flow characteristics, crime neighborhood trend characteristics and long-term trend characteristics, and inter-community correlation relationships; wherein the inter-community correlation relationships are jointly expressed by inter-community spatial topology, POI distribution, and inter-community traffic flow; the crime spatiotemporal distribution prediction model includes: a spatiotemporal feature extraction module and a spatiotemporal feature channel attention module, the spatiotemporal feature extraction module is used to extract the spatiotemporal dependency of community taxi flow characteristics, crime neighborhood trend characteristics, and long-term trend characteristics, and the spatiotemporal feature channel attention module is used to aggregate channel attention and spatial attention results to obtain enhanced features; The prediction module is used to input the real-time taxi flow data into the crime spatiotemporal distribution prediction model to obtain the spatiotemporal distribution results of urban crime.

3. A system for predicting the spatiotemporal distribution of urban crime, characterized in that: include: A memory and a processor, wherein the memory stores a computer program executed by the processor, and when the computer program is executed by the processor, the method for predicting the spatiotemporal distribution of urban crime as claimed in claim 1 is executed.

4. A storage medium, characterized in that: The storage medium stores a computer program, which executes the urban crime spatiotemporal distribution prediction method as claimed in claim 1 when running.