Swarm Intelligence Response Methods Based on Urban Crime Event Prediction

: Cities attract a large number of inhabitants due to their more advanced industrial and commercial sectors and more abundant and convenient living conditions. According to statistics, more than half of the world’s population resides in urban areas, contributing to the prosperity of cities. However, it also brings more crime risks to the city. Crime prediction based on spatiotemporal data, along with the implementation of multiple unmanned drone patrols and responses, can effectively reduce a city’s crime rate. This paper utilizes machine learning and data mining techniques, predicts crime incidents in small geographic areas with short timeframes, and proposes a random forest algorithm based on oversampling, which outperforms other prediction algorithms in terms of performance. The research results indicate that the random forest algorithm based on oversampling can effectively predict crimes with an accuracy rate of up to 95%, and an AUC value close to 0.99. Based on the crime prediction results, this paper proposes a multi-drone patrol response strategy to patrol and respond to predicted high-crime areas, which is based on target clustering and combined genetic algorithms. This strategy may help with the pre-warning patrol planning within an hourly range. This paper aims to combine crime event predictions with crowd-sourced cruise responses to proactively identify potential crimes, providing an effective solution to reduce urban crime rates.


Introduction
In recent years, with the accelerated urbanization process and improved living standards, cities have become hubs for every large population.However, this has also brought about a series of security problems, leading to various types of crimes.According to the statistics from the United Nations Office on Drugs and Crime (UNODC), various types of crimes, including robbery, theft, and violent crimes, are on the rise worldwide [1].Data released by the Chinese Ministry of Public Security shows that overall crime cases in China have been on the rise in recent years, posing serious challenges to social order and public safety [2,3].According to daily statistical reports from the China Emergency Service Network, in July 2018 alone, there were 21,426 reports of warning information and 5129 reports of emergency incidents nationwide [4].Criminal events seriously affect economic development and social stability, posing a significant threat to the safety of people's lives.
With the advancement of artificial intelligence and big data analytics technology, many scholars both domestically and internationally are using spatiotemporal data to predict occurrences of criminal events, providing effective means to reduce crime incidents.Using machine learning, researchers like Jenga [5] have assessed the latest technologies in crime prediction and proposed future research directions in the field of crime prediction.Zhang et al. [6], for instance, extracted patterns and features from historical crime data and improved the accuracy of LSTM models by incorporating built environment covariates.

•
Crime events in short time frames and small areas are predicted, using data mining techniques and various machine learning methods.The specific prediction process is described in Section 3, and the prediction results is described in Section 3.4.4.The random forest algorithm is based on the oversampling proposed in this paper and outperforms other prediction algorithms.The results show that the oversampled random forest prediction has an accuracy of up to 95%, an AUC value close to 0.99, an F1-score of 0.94, and a recall of 0.95; • A drone patrol response strategy built upon the foundation of the previous section is designed based on target clustering, as is described in Section 4. Combined with a genetic algorithm, this strategy can be used for patrols and responds to high-crime areas predicted in advance.The experimental results can help patrol planning with area-wide pre-warning within one hour, providing an effective solution to reduce urban crime rates.
In this study, Figure 1 presents the proposed system structure, which consists of two parts: crime event prediction and the collective intelligence response.It includes a central database, a server, and drones equipped with various sensors (UAVS).The central database stores various feature data and prediction results.The server is the central processing entity in the system, responsible for data preprocessing, model computation, crime prediction, and the allocation of drones to patrolled areas.First, data are inputted into the model on the left, and the predicted output P is set to be the high-crime area in region A n at time period T m , corresponding to Targets i in the circle on the right.Next, UAVS are clustered into UAVS j , where i = j, with each UAV patrolling its corresponding targets.Finally, drones can collect data through sensors during patrolling and feed them back to the dataset before repeating the above process.This paper aims to integrate crime event prediction with the collective intelligence response.It provides a comprehensive approach that can proactively identify potential crime events, optimize resource allocation, and plan response routes, thereby, effectively addressing urban crime issues and enhancing public safety.This approach also offers valuable insights for predicting and responding to other emergent incidents, contributing to the field of smart disaster prevention in cities.

Crime Event Prediction
Crime event prediction involves the utilization of techniques such as data analysis, statistical methods, and machine learning to forecast potential future criminal incidents by analyzing historical crime data along with spatiotemporal factors associated with criminal incidents.
Primarily, crime events are closely correlated with external factors and predicting them involves analyzing and modeling this relationship.In other words, it entails training a model that establishes a connection between crime events and external factors to enable the model to predict criminal incidents.For example, Catlett et al. [7] introduced a predictive approach based on a spatial analysis and autoregressive model.This method employs a density-sensitive clustering algorithm Density-Based Spatial Clustering of Applications with Noise (DBSCAN) [8] and seasonal Autoregressive Integrated Moving Average (ARIMA) [9] models to automatically detect high-risk crime areas within a city and reliably forecast crime trends.
Furthermore, enhancing prediction accuracy can be achieved by analyzing the spatiotemporal characteristics of data.Yi et al. [10] proposed a Clustered Continuous Conditional Random Field (Clustered-CCRF) model that combines autoregressive temporal correlation and feature-based spatial correlation between regions.By utilizing a treebased clustering algorithm, highly similar regions are identified, thereby, enhancing the performance of crime prediction models.Zhang et al. [11] developed an interpretable machine learning crime prediction model that combines Extreme Gradient Boosting (XG-Boost) [12,13] and Shapley additive explanation (SHAP) [14] methods.This model elucidates the precise spatial variation of each variable, thereby, improving the accuracy and transparency of the crime prediction model.Hajela et al. [15] introduced a spatiotemporal crime prediction technique based on machine learning and a two-dimensional hotspot analysis.They employed a finer-grained partitioning method to capture the spatial distribution characteristics of crime and used multiple features and complex classification models to enhance prediction accuracy and robustness.These approaches have achieved certain breakthroughs in the realm of spatiotemporal features.
Additionally, in certain instances, different types of security events may exhibit evident or covert interactions.For instance, Ahsan et al. [16] proposed a machine learning-based approach to analyze and predict road traffic accident risks.They selected multiple attributes as input variables and utilized decision trees and random forest algorithms to predict accidents.Thakkar et al. [17] employed a random forest algorithm to predict fires, calculating the Pearson correlation coefficients between variables and using a correlation matrix to unveil relationships between different factors and the probability of fire occurrence.Their research provided a novel approach and reference for preventing and controlling fires and traffic accidents, concurrently offering valuable insights for the crime event prediction aspect of this paper.
The advantages and disadvantages of the aforementioned technologies are shown in Table 1.
Currently, both domestic and international research on crime event predictions primarily focuses on long-term and large-scale forecasting; yet, such coarse predictions fail to meet modern urban requirements for crime event responses.Therefore, this paper proposes a granular prediction algorithm based on spatiotemporal factors.By utilizing an oversampled random forest algorithm, it forecasts crime incidents in small geographical areas within short time periods for the subsequent collective intelligence responses.

Method/Model Technical Advantages Technical Disadvantages
Spatial analysis and ARIMA [7] Automatic detection of high-risk crime areas using DBSCAN and ARIMA models

Requires appropriate parameter configuration
Clustered-CCRF model [10] Combines temporal and spatial correlation, improving prediction performance

Requires an effective data clustering method
XGBoost and SHAP methods [11] Enhanced model accuracy and transparency, explaining spatial variations May require substantial computational resources 2D hotspot analysis and machine learning [15] Improved prediction accuracy and robustness, fine-grained spatial partitioning Complex classification models may require large datasets Decision trees and random forest [16] Effective prediction of road traffic accidents, multiple input attributes More feature engineering and data preprocessing may be needed Random forest algorithm [17] Revealing correlations between different factors, providing fire prevention methods Data quality and correlations may affect prediction accuracy

Multi-Agent-Based Collective Intelligence Response
In recent years, intelligent agents represented by unmanned aerial vehicles (UAVs), as compared to ground vehicles, have gained widespread application in areas such as missing person searches, medical transports, and emergency communication due to their agility and efficiency [18][19][20][21][22][23][24].Goodrich et al. [25] and Nakadai et al. [26] implemented camera-equipped and microphone-equipped intelligent collectives, respectively, and tested their performance in searching and rescuing tasks.Advanced planning and navigation algorithms are the key for intelligent collectives to accomplish emergency response tasks.Heintzman et al. [27] primarily focused on target-predictive motion models and investigated path planning for human-intelligent collective search and rescue movements.Wu et al. [28] utilized Markov models to address uncertainties in the deployment of intelligent collective-relief personnel.Liu et al. [29] and Huang et al. [30] employed road models to guide intelligent collectives in road anomaly detection and response.Ding et al. [31] improved the Particle Swarm Optimization (PSO) [32] algorithm and applied the enhanced Artificial Bee Colony-Particle Swarm Optimization (ABC-PSO) algorithm to solve task allocation problems, effectively addressing the reassignment of tasks in multi-agent emergency relief scenarios.Han et al. [33] introduced an optimized A* path planning algorithm, allocating intelligent collectives and rapidly devising optimal flight paths.Zhao et al. [34] proposed a unified framework for UAV-assisted disaster emergency networks and investigated optimization problems in three scenarios, including UAV trajectory and scheduling, transmitter-receiver design, multi-hop Device-to-Device (D2D) [35] communication, and multi-hop UAV relay.Jaradat et al. [36] employed a finite-state Q-Learning algorithm to enhance the efficiency of path planning in unknown environments.Liu et al. [37] proposed an improved reinforcement learning method, Neural Networks Heuristic Q-learning (NNH-QL), using Back Propagation (BP) [38] neural networks, enhancing the learning efficiency of the Q-learning algorithm with the neural network's fitting and enabling the algorithm to operate effectively in larger environments.Zhao et al. [39] presented a UAV path planning algorithm based on deep multi-agent reinforcement learning, considering complex urban environments, flight time restrictions, wireless channel characteristics, and various scenario parameters, achieving generalization across diverse scenarios without the need for retraining or adaptation.
The advantages and disadvantages of the aforementioned technologies are shown in Table 2.
These studies collectively demonstrate significant advancements in intelligent collectives for emergency response tasks.Advanced planning and navigation algorithms empower them to efficiently tackle emergency communication and other tasks, offering robust support for societal safety and rescue efforts.However, most existing research predominantly focuses on post-incident responses, while this paper centers on proactive pre-warning patrols and post-emergency responses.By predicting potential events in advance, intelligent collectives can take preemptive measures before incidents occur, effectively managing crises and emergency situations.Urban-scale crime events possess highly dynamic spatiotemporal characteristics, providing intelligent collectives for the opportunity to forecast and optimize patrol strategies, facilitating both swift post-event responses and pre-event measures.This spatiotemporal dynamism presents intelligent collectives with more effective and flexible options for emergency responses.

Approach/Algorithm Technical Advantages Technical Disadvantages
Camera-equipped intelligent collectives [25] Enhanced situational awareness Limited performance in complex tasks Microphone-equipped intelligent collectives [26] Enhanced audio-based search capabilities Limited use in non-audio scenarios Target-predictive motion models [27] Improved path planning for collective Complexity in modeling target motion Markov models [28] Addressing uncertainties effectively Limited applicability in certain tasks Road models [29] Effective guidance for road-based tasks Limited to tasks related to roads Enhanced PSO (ABC-PSO) algorithm [31] Improved task reassignment in emergencies Potential complexity in parameter tuning Optimized A* path planning algorithm [33] Rapid task allocation and path planning May not handle complex urban scenarios Trajectory and scheduling optimization [34] Comprehensive framework for UAV scenarios May require complex optimization Finite-state Q-Learning algorithm [36] Enhanced path planning in unknown areas Limited to simple Q-learning scenarios Neural Networks Heuristic Q-learning [37] Improved learning efficiency Potential complexity in neural networks Deep multi-agent reinforcement learning [39] Generalization across diverse scenarios Complex learning and adaptation process

Overview of Denver Crime Datasets
In this paper, publicly available datasets from the city of Denver in the United States were utilized.These datasets encompass spatiotemporal information from 2016 to 2021.The raw data comprise 546,882 rows and 19 columns, with each row representing an individual event record and each column representing distinct attributes of the event, as illustrated in Table 3.This dataset encompasses a total of 19 attributes.The original dataset contains 19 attributes, some of which are irrelevant to this study.These redundant attributes are removed from the analysis.

Handling Missing Values
The original datasets comprise 546,882 records, after analyzing with the latitude and longitude that exhibit the most severe instances of missing values which account for approximately 0.8% of the total.As the proportion of missing values is relatively small, after these instances were removed, a final dataset of 505,285 records were left.

Spatial Division
This paper employs the United States National Grid (USNG) system to convert GPS coordinates into unique block identifiers serving as new input features.This feature is labeled as "Grid_3Km_no", offering accuracy down to 10 m.The study divides the area into grid cells of 3 km × 3 km, resulting in a total of 84 grids.This division approach enhances the foundation for model training.

Temporal Correlation Analysis
In this section, an analysis of the number of crime events, which occurred during different time periods in Denver, is conducted, with different time intervals exhibiting distinct patterns in the distribution of crime events.As is shown in Figure 2a, there is a fluctuation in the number of crime events between 2020 and 2021, displaying an upward trend.This suggests that public security in Denver still requires improvement.Figure 2b illustrates the monthly distribution of crime events.The results reveal that August has the highest occurrence rate of crime events, followed by July and January, while February witnesses the lowest number of incidents.Figure 2c delves into the impact of dates within each month on the number of crime events.Notably, there is a dip in occurrences on the 31st day, as not all months have 31 days.On the contrary, a peak is observed on the 1st day, possibly attributed to New Year's Day and its higher population density, which may lead to an abnormal increase in crime incidents.distinct patterns in the distribution of crime events.As is shown in Figure 2a, there is a fluctuation in the number of crime events between 2020 and 2021, displaying an upward trend.This suggests that public security in Denver still requires improvement.Figure 2b illustrates the monthly distribution of crime events.The results reveal that August has the highest occurrence rate of crime events, followed by July and January, while February witnesses the lowest number of incidents.Figure 2c delves into the impact of dates within each month on the number of crime events.Notably, there is a dip in occurrences on the 31st day, as not all months have 31 days.On the contrary, a peak is observed on the 1st day, possibly attributed to New Year's Day and its higher population density, which may lead to an abnormal increase in crime incidents.As is depicted in Figures 2d and 3, there are significant variations in the number of crime events during different time intervals throughout the day.On workdays, the occurrences of crime events peak between 12:00 and 18:00, with a smaller peak observed between 12:00 and 13:00.On weekends, the distribution trend of crime events is similar to that of the workdays.Before 5:00 AM, the total number of crime events on weekends tends to surpass that of the workdays.As is depicted in Figures 2d and 3, there are significant variations in the number of crime events during different time intervals throughout the day.On workdays, the occurrences of crime events peak between 12:00 and 18:00, with a smaller peak observed between 12:00 and 13:00.On weekends, the distribution trend of crime events is similar to that of the workdays.Before 5:00 AM, the total number of crime events on weekends tends to surpass that of the workdays.As is depicted in Figure 2d and Figure 3, there are significant variations in the number of crime events during different time intervals throughout the day.On workdays, the occurrences of crime events peak between 12:00 and 18:00, with a smaller peak observed between 12:00 and 13:00.On weekends, the distribution trend of crime events is similar to that of the workdays.Before 5:00 AM, the total number of crime events on weekends tends to surpass that of the workdays.The aforementioned analysis shows a close correlation between the occurrence of crime events and temporal factors.Consequently, features such as year (Year), month (Month), weekday (Week), and hour (Hour) are chosen as temporal features for the The aforementioned analysis shows a close correlation between the occurrence of crime events and temporal factors.Consequently, features such as year (Year), month (Month), weekday (Week), and hour (Hour) are chosen as temporal features for the analysis and modeling, with an aim to achieve accurate crime event predictions and swift responses for an optimized resource allocation.This approach seeks to enhance public safety and effectively deal with security risks that arise during various time periods.

Spatial Correlation Analysis
In this section, we delve into the correlation between crime events and spatial factors.By means of a statistical analysis, the spatial distribution patterns of crime events can be derived, as is depicted in Figure 4.The entire city is partitioned into seven police districts, with each color representing the distribution of crime events in a specific district.A distinct difference in district sizes is evident, as seen from the Figure.Specifically speaking, District 3 has the largest area, followed by Districts 4 and 5, while District 6 encompasses the smallest area.This implies that District 3 covers a relatively larger area, and likely encompasses the most densely populated regions and various social activity hubs, which may result in a higher concentration of crime events.In contrast, District 7's smaller area might indicate a more secluded region or a relatively sparser community population, potentially leading to fewer crime events and a comparatively safer environment.The aforementioned analysis shows a close correlation between the occurrence of crime events and temporal factors.Consequently, features such as year (Year), month (Month), weekday (Week), and hour (Hour) are chosen as temporal features for the analysis and modeling, with an aim to achieve accurate crime event predictions and swift responses for an optimized resource allocation.This approach seeks to enhance public safety and effectively deal with security risks that arise during various time periods.

Spatial Correlation Analysis
In this section, we delve into the correlation between crime events and spatial factors.By means of a statistical analysis, the spatial distribution patterns of crime events can be derived, as is depicted in Figure 4.The entire city is partitioned into seven police districts, with each color representing the distribution of crime events in a specific district.A distinct difference in district sizes is evident, as seen from the Figure.Specifically speaking, District 3 has the largest area, followed by Districts 4 and 5, while District 6 encompasses the smallest area.This implies that District 3 covers a relatively larger area, and likely encompasses the most densely populated regions and various social activity hubs, which may result in a higher concentration of crime events.In contrast, District 7's smaller area might indicate a more secluded region or a relatively sparser community population, potentially leading to fewer crime events and a comparatively safer environment.However, reality does not always adhere to this notion.The size of a district does not necessarily correlate with the number of crime events, as is shown in Figure 4, which presents a heatmap of crime events in Denver.This heatmap illustrates the density of crime events within each police district, with brighter colors indicating a higher crime event density.Despite District 6 having the smallest area, it displays the highest crime density, indicating that it is a hotspot for criminal activity.This might be linked to factors such as population density, social activity hubs, or other variables that concentrate criminal inci- However, reality does not always adhere to this notion.The size of a district does not necessarily correlate with the number of crime events, as is shown in Figure 4, which presents a heatmap of crime events in Denver.This heatmap illustrates the density of crime events within each police district, with brighter colors indicating a higher crime event density.Despite District 6 having the smallest area, it displays the highest crime density, indicating that it is a hotspot for criminal activity.This might be linked to factors such as population density, social activity hubs, or other variables that concentrate criminal incidents in this region.On the other hand, despite District 3's area being the largest, its crime event density is relatively low.This suggests that while the district covers a larger region, it might include relatively safer communities or areas.
Taking into consideration the analysis from both Figures 4 and 5, it can be concluded that the size of a police district does not directly determine the number of crime events.In fact, the spatial distribution of crime events is more influenced by internal social and environmental factors within each district.Therefore, when formulating crime prevention measures, it is crucial to consider both the district's size and the hotspots of criminal activity within it.In this way, targeted measures can be adopted to enhance public safety effectively.
Electronics 2023, 12, x FOR PEER REVIEW 9 of 2 event density is relatively low.This suggests that while the district covers a larger region it might include relatively safer communities or areas.
Taking into consideration the analysis from both Figures 4 and 5, it can be concluded that the size of a police district does not directly determine the number of crime events.In fact, the spatial distribution of crime events is more influenced by internal social and en vironmental factors within each district.Therefore, when formulating crime prevention measures, it is crucial to consider both the district's size and the hotspots of criminal ac tivity within it.In this way, targeted measures can be adopted to enhance public safety effectively.

Feature Selection
Based on the aforementioned analysis, it is evident that the factors influencing crime primarily involve temporal and spatial aspects.To facilitate model computation and max imize the utilization of these attributes for predicting the probability of crime occurrence within a region, this paper has selected 14 attributes, as are illustrated in Table 4. Gird_3Km_no IS_TRAFFIC Among these attributes, "A_P_M," "INCIDENT_ADDRESS," "PRECINCT_ID," and "NEIGHBORHOOD_ID" are nominal variables that need a Dummy Variable to be pro cessed.Thus, one-hot encoding is employed to convert these nominal variables into binary vectors.This approach enhances the model's ability to comprehend and process the data

Feature Selection
Based on the aforementioned analysis, it is evident that the factors influencing crime primarily involve temporal and spatial aspects.To facilitate model computation and maximize the utilization of these attributes for predicting the probability of crime occurrence within a region, this paper has selected 14 attributes, as are illustrated in Table 4.Among these attributes, "A_P_M", "INCIDENT_ADDRESS", "PRECINCT_ID", and "NEIGHBORHOOD_ID" are nominal variables that need a Dummy Variable to be processed.Thus, one-hot encoding is employed to convert these nominal variables into binary vectors.This approach enhances the model's ability to comprehend and process the data more effectively.

Crime Event Prediction
This section focuses on predicting crime events.Considering both temporal and spatial factors, precise patterns and distribution characteristics of events are captured through the analysis of historical data and real-time information.This is achieved using an oversampling-based random forest algorithm to accurately predict crime events occurring within a short time frame in a small area.

Problem Description
Initially, the time series T is defined as a set comprising time points, denoted as T = {t 0 , t 1 , • • • , t m }, where m ∈ [0, 23].Here, m represents the division of a day into 24 equidistant time intervals, each spanning 1 h.This equidistant division of time intervals enhances the time series' temporal relevance.
Subsequently, the spatial sequence A is defined as a collection composed of spatial regions, represented as A = {a 0 , a 1 , • • • , a n }, where n ∈ [0, k].In this context, n signifies the division of geographical latitude and longitude into distinct regions, with a n signifying the nth region.This grid-based partitioning facilitates the segmentation of geographical space into numerous smaller areas, facilitating the analysis of region-specific attributes and the spatial localization of crime incidents.
By merging the time series and spatial sequence, it becomes possible to conduct the analysis and prediction of crime incidents within specific time intervals and designated spatial regions.
Furthermore, the forecasting objective is as follows: the primary goal of this study is to predict the locations of crime incidents occurring within each hour, alongside estimating the probability of crime occurrences at each location.This can be represented in the following manner: Equation ( 1) signifies the probability of a crime incident occurring in the time interval [m, m + 1] at location a 0 .Here, T represents the time series, t m denotes the mth hour, A signifies the spatial sequence, a n represents the nth region, and P represents probability.The term "IsCrime = 1" within the formula signifies the occurrence of a crime incident at the specific location a n during the provided time interval t m .

Crime Prediction Model
The traditional Random Forest algorithm typically employs balanced sample sets during the training process of each decision tree.However, when dealing with imbalanced datasets, certain classes may have fewer samples, which can lead to a poorer performance of the model in predicting minority classes.Oversampling-based Random Forest algorithms can enhance the classification performance on imbalanced datasets, as the use of oversampling techniques helps balance the data distribution among different classes by replicating existing minority class samples or generating new synthetic samples.This, in turn, improves the model's ability to learn from minority classes.
For each sample x in the minority class, calculate its Euclidean distance to all samples in the minority class sample set to obtain its k nearest neighbors.Based on the imbalance ratio of the dataset, set a sampling ratio to determine the sampling multiplier N.For each minority class sample x, randomly select several samples from its k nearest neighbors, assuming the selected neighbors are denoted as x new .For each randomly selected neighbor x new , construct a new sample according to Formula (2).
The positive-to-negative sample ratio in this dataset is approximately 3:1, as illustrated in Figure 6.Negative samples are augmented to achieve a 1:1 positive-to-negative sample ratio.To prevent overfitting, assess the model's performance objectively, and ascertain its generalization capability; the 5-Fold Cross Validation method is employed.The original training dataset was evenly divided into five subsets.Each subset's data were used as a validation set in turn, while the remaining four subset data served as the training set, and this process was iterated.The model's performance, as indicated in Table 5, demonstrates a notably high average accuracy, approximately 0.95, especially in the oversampled random forest model.Consequently, after data preprocessing, the original dataset was randomized and split in an 8:2 ratio to create a training set and a test set.A random forest model with oversampling is used for crime prediction.Random forests utilize a decision tree approach, involving an optimal feature selection, with criteria such as the Gini Index and Information Gain [40].Here, the Gini Index is used as the splitting criterion.This metric is highly sensitive in classification problems and effectively measures the impurity between different categories.As is shown in Table 6 through a simple validation, it can be observed that this metric results in a shorter training and prediction time.This makes it particularly advantageous to deal with large datasets, as it can significantly improve computational speed and reduce processing times.

Crime Prediction Process
As is shown in Figure 7, the crime event prediction process in this paper follows the following steps: 1.
Data Collection and Preprocessing.Collect historical crime data and other relevant information, and preprocess the data as necessary, including handling missing values, outlier treatment, and more.2.
Feature Engineering.Construct appropriate feature variables based on the data analysis' results, which may include factors related to crime events such as time, location, etc.

Crime Prediction Results
According to the prediction process shown in Figure 7, crime events were forecasted.The prediction models are evaluated using metrics such as the accuracy, precision, recall, and F1-score, and were compared with algorithms including logistic regression, decision trees, Bayesian methods, random forests, and KNN [5][6][7].Precision is the ratio of true positives (TP) to the sum of true positives (TP) and false positives (FP), recall is the ratio of true positives (TP) to the sum of true positives (TP) and false negatives (FN), and the F1-score is the harmonic mean of precision and recall.Accuracy refers to the percentage of correct predictions [5,13].As is shown in Table 7, the oversampled random forest model utilized in this study exhibits a superior performance.

Crime Prediction Results
According to the prediction process shown in Figure 7, crime events were forecasted.The prediction models are evaluated using metrics such as the accuracy, precision, recall, and F1-score, and were compared with algorithms including logistic regression, decision trees, Bayesian methods, random forests, and KNN [5][6][7].Precision is the ratio of true positives (TP) to the sum of true positives (TP) and false positives (FP), recall is the ratio of true positives (TP) to the sum of true positives (TP) and false negatives (FN), and the F1-score is the harmonic mean of precision and recall.Accuracy refers to the percentage of correct predictions [5,13].As is shown in Table 7, the oversampled random forest model utilized in this study exhibits a superior performance.As is shown in Figure 8, the confusion matrices are presented for each crime prediction model.Clearly, the oversampled random forest model exhibits the highest proportion of TP (True Positives) and TN (True Negatives), indicating the best predictive performance.Therefore, for the remaining sections of this paper, we will use this model as the basis for predictions.This section validates the algorithm's performance by evaluating the model's complexity.The experiments were conducted on a computer equipped with an Nvidia RTX 3080 graphics card and a dedicated 16-thread CPU.Table 8 presents the average accuracy, training time, testing set prediction time, and real-time simulation prediction time for each model over the 5-fold cross-validation.It can be observed that although the random forest model achieves the highest accuracy, it also exhibits relatively longer execution times, indirectly reflecting its higher computational complexity.However, in terms of real-time predictions, most models are completed within 10 s, achieving a nearly-real-time forecasting.In the future, we aim to further enhance the models, reduce the model's complexity, and improve their prediction accuracy.This section validates the algorithm's performance by evaluating the model's complexity.The experiments were conducted on a computer equipped with an Nvidia RTX 3080 graphics card and a dedicated 16-thread CPU.Table 8 presents the average accuracy, training time, testing set prediction time, and real-time simulation prediction time for each model over the 5-fold cross-validation.It can be observed that although the random forest model achieves the highest accuracy, it also exhibits relatively longer execution times, indirectly reflecting its higher computational complexity.However, in terms of real-time predictions, most models are completed within 10 s, achieving a nearly-real-time forecast-ing.In the future, we aim to further enhance the models, reduce the model's complexity, and improve their prediction accuracy.As depicted in Figure 9, the AUC value of the random forest curve approaches 0.99, which is the highest among the presented models.This signifies that, in terms of the AUC evaluation metric, the random forest model excels in the classification prediction performance.Based on the analysis results presented above, data for the model input from 5 PM to 6 PM on a certain day are randomly selected.As is shown in Figure 10, each red dot represents a crime event and includes attributes such as the time, location, and likelihood of the event occurring.The data input to the model every hour is updated based on information collected by various sensors, enabling real-time crime predictions.Target points are extracted from the prediction results.These target points form the basis for multiagent patrolling, which will be elaborated on in the subsequent chapters.

Multi-Drone Response Based on Crime Prediction
In this section, we will discuss the cruise response to the extracted target points.As depicted in Figure 8, each red point represents a target point for drone patrol.Consequently, the challenge of a group intelligence response can be viewed as a multi-target response problem.As the number of targets increases and the coverage area expands, issues such as prolonged response times and complex algorithmic calculations arise.This hampers the identification of an optimal response allocation scheme.To address these challenges, this paper proposes a drone response strategy based on target clustering, coupled with an enhanced genetic algorithm for simulating patrol responses.

Problem Description
The multi-drone cruise response strategy can be described as follows: Given N predicted crime points as targets, employ the k-means algorithm to cluster Based on the analysis results presented above, data for the model input from 5 PM to 6 PM on a certain day are randomly selected.As is shown in Figure 10, each red dot represents a crime event and includes attributes such as the time, location, and likelihood of the event occurring.The data input to the model every hour is updated based on information collected by various sensors, enabling real-time crime predictions.Target points are extracted from the prediction results.These target points form the basis for multi-agent patrolling, which will be elaborated on in the subsequent chapters.

Multi-Drone Response Based on Crime Prediction
In this section, we will discuss the cruise response to the extracted target points.As depicted in Figure 8, each red point represents a target point for drone patrol.Consequently, the challenge of a group intelligence response can be viewed as a multi-target response problem.As the number of targets increases and the coverage area expands, issues such as prolonged response times and complex algorithmic calculations arise.This hampers the identification of an optimal response allocation scheme.To address these challenges, this paper proposes a drone response strategy based on target clustering, coupled with an enhanced genetic algorithm for simulating patrol responses.

Problem Description
The multi-drone cruise response strategy can be described as follows: Given N predicted crime points as targets, employ the k-means algorithm to cluster the targets in the response area M clusters.Consequently, the task of accessing N target points from M centers can be treated as a multi-center drone task allocation problem.Each center can dispatch a maximum of K m drones (m = 1, 2, . .., M), and any drone associated with the centroid of a target can access that target point.The objective is to design a rational drone dispatch plan to minimize the drone flight paths while satisfying the following constraints: 1.
Each target point must be accessed by only one drone, i.e., multiple drones cannot pass through a single target point simultaneously; 2.
Drones must return to their original centers after visiting the target points, with the determined center as the starting point.
For the purpose of simplifying the model complexity, let the target points be encoded as {1, 2, 3, 4, 5, . .., N}, and the center codes as {N + 1, N + 2, N + 3, . .., N + M}.Define the variable x mk ij to indicate whether drone k from the center m travels from target point i to target point j.If no travel occurs, x mk ij is assigned a value of 0; otherwise, x mk ij is assigned a value of 1, as shown in Equation (3): The driving distance is denoted as totalDist, as shown in Equation (4): The objective function aims to minimize the cost, where the cost is defined as the total distance multiplied by the distance weight, as expressed in Equation (5).The weights represent the probability of a crime event occurring at each target point.mintotalCoat = totalDist * Weight (5) Among the constraints (6)-( 9), Equation (6) stipulates that the starting and ending points of a drone's cruise must be its associated center.Equations ( 7) and (8) denote that each target point should be visited by only one drone.Equation (9) ensures that drones cannot travel from one center to another center.Initially, the k-means algorithm is employed to cluster targets within the response area based on the principle of minimizing distances.This is illustrated in Figure 11, where the right-side red section depicts the clustering of the target set into M clusters, each denoted as Cluster i (where i = 1, 2, 3, . .., M).The left-side blue section represents the grouping of Unmanned Aerial Vehicles (UAVs), where drones are divided into M groups according to the same principle of an equal number of clusters and groups, each denoted as Group i (where i = 1, 2, 3, . .., M).Subsequently, cluster allocation is performed.Subsequently, following the strategy depicted in Figure 11, the predicted target points are clustered, resulting in the configuration in Figure 12.In this representation, red cross markers denote the centroids of each cluster, and the surrounding points of the same color signify multiple targets within each respective cluster.Finally, an exemplary cruise response cluster is chosen from the clusters, as is illustrated in Figure 12.The cluster selected by the red circle is extracted, encompassing a total of 46 target points.However, it is important to note that some selected targets might appear duplicated due to multiple occurrences at certain locations.Yet, for the purpose of drone cruising, a single localization suffices, allowing for the removal of duplicates while Subsequently, following the strategy depicted in Figure 11, the predicted target points are clustered, resulting in the configuration in Figure 12.In this representation, red cross markers denote the centroids of each cluster, and the surrounding points of the same color signify multiple targets within each respective cluster.Subsequently, following the strategy depicted in Figure 11, the predicted target points are clustered, resulting in the configuration in Figure 12.In this representation, red cross markers denote the centroids of each cluster, and the surrounding points of the same color signify multiple targets within each respective cluster.Finally, an exemplary cruise response cluster is chosen from the clusters, as is illustrated in Figure 12.The cluster selected by the red circle is extracted, encompassing a total of 46 target points.However, it is important to note that some selected targets might appear duplicated due to multiple occurrences at certain locations.Yet, for the purpose of Finally, an exemplary cruise response cluster is chosen from the clusters, as is illustrated in Figure 12.The cluster selected by the red circle is extracted, encompassing a total of 46 target points.However, it is important to note that some selected targets might appear duplicated due to multiple occurrences at certain locations.Yet, for the purpose of drone cruising, a single localization suffices, allowing for the removal of duplicates while still meeting the cruising criteria.This refinement leads to a reduced set of 36 unique target points, as demonstrated in Figure 13.The same procedure can be applied to other clusters, enabling concurrent responses.

Cruise Algorithm
This paper employs an enhanced genetic algorithm for the drone cruise response, as is depicted in Figure 14.The figure outlines the fundamental steps of the genetic algorithm process.After finalizing the algorithm, improvements were made to the crossover operation.Unlike the traditional crossover approach, this paper introduces an enhanced crossover operation which is depicted in Figure 15.The specific steps are outlined as follows: 1. Set a mutation probability p. 2. For each parent chromosome in the population:

Cruise Algorithm
This paper employs an enhanced genetic algorithm for the drone cruise response, as is depicted in Figure 14.The figure outlines the fundamental steps of the genetic algorithm process.After finalizing the algorithm, improvements were made to the crossover operation.Unlike the traditional crossover approach, this paper introduces an enhanced crossover operation which is depicted in Figure 15.The specific steps are outlined as follows: 1. Set a mutation probability p.After finalizing the algorithm, improvements were made to the crossover operation.Unlike the traditional crossover approach, this paper introduces an enhanced crossover operation which is depicted in Figure 15.The specific steps are outlined as follows: 1.
Set a mutation probability p.

2.
For each parent chromosome in the population: a.
Randomly select a crossover point, G1, within the chromosome.Let us say G1 = 34.b.
Generate a random decimal number, R, between 0 and 1. c.
If R < p, go to Step 3. Otherwise, proceed to Step 4. Locate G1 = 34 within Parent B's chromosome and identify the point before it as G3.c.
Invert the segment between G1 and G3 in the original parent chromosome.

5.
Repeat the above steps for all parent chromosomes to generate the offspring population.The cross-operator enhancement Algorithm 2 pseudocode is as follows: As is shown in Figure 16a, the cruise trajectories from the experimental simulation are illustrated.The four distinct colors correspond to the four individual drones, and their trajectories neither overlap nor revisit the target points.This approach ensures an efficient enhancement of response efficiency.Furthermore, Figure 16b depicts the population evolution curve.The objective function gradually converges to its optimal value as the iteration count increases.By the time it reaches 400 iterations, it demonstrates a near-complete convergence.
within these clusters, and each target is sequentially numbered with 0 to 35.The experiment involves four drones, and the outcomes are presented in Table 9.Each row represents the response route of an individual drone, starting from point 0, returning to point 0, and ensuring that each target point is visited only once.As is shown in Figure 16a, the cruise trajectories from the experimental simulation are illustrated.The four distinct colors correspond to the four individual drones, and their trajectories neither overlap nor revisit the target points.This approach ensures an efficient enhancement of response efficiency.Furthermore, Figure 16b depicts the population evolution curve.The objective function gradually converges to its optimal value as the iteration count increases.By the time it reaches 400 iterations, it demonstrates a near-complete convergence.In addition, as is shown in Table 10, we also use the Ant Colony Optimization (ACO) algorithm for comparison.It is evident that the algorithm employed in this study yielded notably favorable results.An equal number of drones being considered, the algorithm demonstrates fewer iterations and shorter flight distances compared to the ACO algorithm.These findings underscore the effectiveness of the approach employed in the current study, showcasing its potential for optimizing drone routing and responses in scenarios with similar parameters.In addition, as is shown in Table 10, we also use the Ant Colony Optimization (ACO) algorithm for comparison.It is evident that the algorithm employed in this study yielded notably favorable results.An equal number of drones being considered, the algorithm demonstrates fewer iterations and shorter flight distances compared to the ACO algorithm.These findings underscore the effectiveness of the approach employed in the current study, showcasing its potential for optimizing drone routing and responses in scenarios with similar parameters.This article proposes a crowdsourced response method based on crime event predictions.Firstly, the Section 3 of the article predicts crime hotspots using a random forest algorithm based on oversampling.Secondly, a drone response strategy based on target clustering is designed in the Section 4 of the article.This strategy clusters, segments, and extracts the predicted crime hotspots, addressing the issue of high computational complexity in the multi-target response.Finally, an improved genetic algorithm is combined for a patrol response to obtain the optimal response allocation scheme.The specific research contributions are as follows: 1.
High Accuracy: This method achieves a high accuracy of up to 95% in both the prediction and response, indicating its effectiveness in crime event predictions.

2.
Prediction Granularity: The method can provide predictions on an hourly basis, enabling real-time prediction and warning responses, which are highly valuable for urban public safety management.

3.
Intelligent Response Strategy: By using target clustering in the drone response strategy, responses to multiple targets can be effectively handled to reduce computational complexity and enhance response efficiency.4.
Genetic Algorithm Optimization: Combining genetic algorithms for optimizing patrol responses allows for finding the best response allocation scheme, reducing the number of iterations, and further improving the response effectiveness.

5.
Providing Public Safety Insights: While perfect accuracy cannot be achieved, this method can offer valuable insights that contribute to urban public safety governance and help reduce crime rates.
This article has yielded positive results to realize real-time crime prediction and alert responses.Additionally, leveraging deep learning and artificial intelligence techniques can improve the prediction algorithm, making it more adaptive and refined.This can help in better recognizing new crime patterns and trends, as well as enabling timely decisionmaking.Moreover, the predictions and patrol alerts presented in the article offer valuable insights for urban public safety governance.However, the article only considers a limited set of factors, and thus, it cannot achieve complete accuracy.To obtain more accurate prediction results, it is essential to identify additional crime attributes beyond the ones currently considered.So far, the method has been trained using specific attributes, but it should explore more factors to enhance its accuracy.

Electronics 2023 , 25 Figure 1 .
Figure 1.System structure proposed in this study.

Figure 2 .
Figure 2. Temporal correlation analysis.(a) The trend of crime numbers over the years; (b) The trend of crime numbers over the months; (c) The trend of crime numbers over the days; (d) The trend of crime numbers over the hours.

Figure 2 .
Figure 2. Temporal correlation analysis.(a) The trend of crime numbers over the years; (b) The trend of crime numbers over the months; (c) The trend of crime numbers over the days; (d) The trend of crime numbers over the hours.

Figure 2 .
Figure 2. Temporal correlation analysis.(a) The trend of crime numbers over the years; (b) The trend of crime numbers over the months; (c) The trend of crime numbers over the days; (d) The trend of crime numbers over the hours.

Figure 3 .
Figure 3. Incidence of crime by time of week.

Figure 3 .
Figure 3. Incidence of crime by time of week.

23 Figure 3 .
Figure 3. Incidence of crime by time of week.

Figure 4 .
Figure 4. Illustration of the distribution of crime incidents across police precincts.

Figure 4 .
Figure 4. Illustration of the distribution of crime incidents across police precincts.

Figure 5 .
Figure 5. Displays of a heatmap of crime incidents.

Figure 5 .
Figure 5. Displays of a heatmap of crime incidents.

3 .Figure 7 .
Figure 7. Outlines of the process flow for crime event prediction.

Figure 7 ., t 1 ,
Figure 7. Outlines of the process flow for crime event prediction.

Figure 8 .
Figure 8.The Confusion Matrices of the Six Models.

Figure 8 .
Figure 8.The Confusion Matrices of the Six Models.

Figure 10 .
Figure 10.Visualization of the predictive results.

Figure 9 .
Figure 9. Illustrates the AUC curves for various models.

Figure 11 .
Figure 11.Depiction of the process of target clustering.

Figure 12 .
Figure 12.Display of the results of target clustering.Different colored dots represent different target clusters, and red cross symbols represent cluster centroids.

Figure 11 .
Figure 11.Depiction of the process of target clustering.

Figure 11 .
Figure 11.Depiction of the process of target clustering.

Figure 12 .
Figure 12.Display of the results of target clustering.Different colored dots represent different target clusters, and red cross symbols represent cluster centroids.

Figure 12 .
Figure 12.Display of the results of target clustering.Different colored dots represent different target clusters, and red cross symbols represent cluster centroids.

Figure 14 .
Figure 14.Outline of the basic process of the genetic algorithm.

Figure 13 . 23 Figure 13 .
Figure 13.The selected target outcomes.4.2.2.Cruise AlgorithmThis paper employs an enhanced genetic algorithm for the drone cruise response, as is depicted in Figure14.The figure outlines the fundamental steps of the genetic algorithm process.

Figure 14 .
Figure 14.Outline of the basic process of the genetic algorithm.

2 .
For each parent chromosome in the population: a. Randomly select a crossover point, G1, within the chromosome.Let us say G1 = 34.b.Generate a random decimal number, R, between 0 and 1. c.If R < p, go to Step 3. Otherwise, proceed to Step 4. 3.If R < p (mutation occurs): a. Randomly select another point, G2, from the same individual's chromosome.b.Invert the segment between G1 and G2.

Figure 14 .
Figure 14.Outline of the basic process of the genetic algorithm.
point, G2, from the same individual's chromosome.b.Invert the segment between G1 and G2.4.If R ≥ p (no mutation): a. Select another individual, Parent B, randomly from the population.b.

Figure 15 .
Figure 15.Illustrations of the Enhanced Genetic Operations.

Figure 16 .
Figure 16.Cruise results.(a) Cruise trajectories of UAVs, where different colors represent different UAVs; (b) Population evolution curve, which shows the convergence of population evolution.

Figure 16 .
Figure 16.Cruise results.(a) Cruise trajectories of UAVs, where different colors represent different UAVs; (b) Population evolution curve, which shows the convergence of population evolution.

Table 1 .
Summary of Works Related to Crime Event Prediction.

Table 2 .
Summary of Works Related to Collective Intelligence Response.

Table 3 .
Attributes of the Crime Dataset.

Table 4 .
Selected Features for the Analysis.

Table 4 .
Selected Features for the Analysis.

Table 6 .
Time and Accuracy of Different Metrics.

Table 8 .
The Time Complexity of the Model.

Table 8 .
The Time Complexity of the Model.

Table 10 .
Comparative Simulation Results of Different Algorithms.

Table 10 .
Comparative Simulation Results of Different Algorithms.