Optimal Ambulance Positioning for Road Accidents With Deep Embedded Clustering

The number of casualties and fatalities brought on by road accidents is one of the most significant concerns in the modern world. Instead of dispatching ambulances only at the time of demand, pre-positioning them can reduce the response time and provide prompt medical attention. Deep learning techniques hold great potential and have proven to be essential for problem-solving and decision-making in the field of healthcare services. This study introduces a deep-embedded clustering-based approach to predict optimal locations for ambulance positing. Various factors and patterns in a geographical region greatly influence the occurrence of road crashes, hence understanding such relationships while model building is crucial. The present study also emphasizes the need of preserving such patterns during model building to ensure real-time results and implements them with the help of another deep-learning-based model, Cat2Vec. The proposed framework is also compared with traditional clustering algorithms like K-means, GMM, and Agglomerative clustering. Moreover, to calculate response time and distance in real time, a novel scoring function has also been introduced for the performance evaluation of various algorithms. The proposed ambulance-positing system exhibits remarkable performance, achieving an accuracy of 95% with k-fold cross-validation and a novel distance score of 7.581 proving the use of the proposed approach is better than all the other traditional algorithms used.


I. INTRODUCTION
Today one of the leading causes of death worldwide among children and adults is road accidents. The injuries caused by these fatal accidents cause considerable economic and personal losses to individuals, their families, and the country. An estimated 1.3 million individuals each year die as a result of road accidents. Between 20 and 50 million individuals experience non-fatal injuries, with many of them becoming disabled as a result [1]. The ever-increasing growth in the number of automobiles is certain to have some negative The associate editor coordinating the review of this manuscript and approving it for publication was Yanli Xu . consequences, the most likely of which is an increase in the frequency of fatal road accidents in densely populated places, resulting in a huge burden on the urban infrastructure. It is dreaded that if we fail to take definitive precautionary measures to overcome these statistics, then road accidents will take over as the fifth major cause of death by 2030. Despite these fatal consequences, this problem receives scanty attention and there is a lack of developing systematic methods to improve road safety.
Studies show that over 90 percent of the global traffic accidents occur in medium to lower income countries such as Kenya [2], [3] which is one such example as more than a thousand fatalities occur due to road crashes consisting of a mean of 7 out of 35 casualties each day [4]. Majority of these deaths and severe injuries occur to the population of 15-59 years who are also the economically active citizens of the country, reducing the economic activity of the country.. Kenya, as a country ranking in the range of lower-middleincome, has seen an increase in regional trade deals over the past decade. Based on the reports from National Transport Safety Authority (NTSA), which is the agency responsible for transportation in Kenya, a record of 5186 minor injuries, 6938 major injuries and 3572 deaths was concluded in 2019.
The number of injuries, and fatalities brought on by these deadly accidents can be decreased if preventive measures are taken, the most crucial of which are prompt medical attention for accident victims, information about the precise situation to the aid personnel, and accurate data analysis considering every single factor to diagnose and predict the accident-prone zones in a city. The delay in the arrival of an ambulance has a significant impact on human life especially in the case of emergency response pertaining to road accidents [5]. If the ambulance fails to reach the crash site in the critical hour, casualties may increase, therefore making each second very significant to human life. In every big metropolis, choosing the best places to place emergency responders throughout the day as they wait to be summoned is essential due to the dense traffic patterns and the city's distinctive layout. Monitoring and controlling these killer accidents is even more difficult due to the lack of expertise in stationing emergency response systems. Therefore, the prompt, automated, and timely positioning of ambulances can aid the first responders and doctors by reducing the effort required on their end and enabling earlier treatment decisions.
In this modern era technologies like machine learning and deep learning have always proven to be an emphatic and prevalent approach to decision-making, especially in the field of medical services. The advent of these technologies has been helpful in various road safety problems and their usefulness can also be found in our problem statement. Healing all patients and eliminating casualties in road accidents is needed of the hour as the end goal of improvement in Health Care Output (HCO). This paper considers the optimal positioning of the ambulance (paramedic help) as a clustering problem, since clustering algorithms ensure optimal locations based on distance metrics and, the coordinates of each centroid are the means of the coordinates of the objects in the cluster [6]. Traditional machine learning approaches such as k-means clustering, PAM clustering, Agglomerative clustering, etc. are not adequately versed and practical in all kinds of clustering problems [7]. This causes a novel deep learning-based technique to develop, which is an exercisable way to enhance this process' performance.
In this study, we propose a novel clustering-based approach utilizing Deep Embedded Clustering with Autoencoder (DEC-AE) to address the problem of optimal ambulance positioning in a city. Unlike traditional clustering methods, the DEC-AE method offers a comprehensive framework that combines deep learning, clustering, and autoencoder techniques [23] to optimize ambulance positioning strategies. By reconstructing the input data from the learned latent representations, DEC can effectively capture the essential features and dimensions that contribute to the clustering process. Furthermore, DEC employs a joint optimization objective [24] that integrates clustering assignments and feature learning. This joint optimization facilitates the enhancement of cluster separability and the generation of compact and well-separated clusters in the latent space. DEC-AC combines deep learning and adaptive clustering [25] to provide an effective solution for clustering problems. It leverages deep neural networks to learn meaningful feature representations and adaptively determines the number of clusters based on the data distribution.
Additionally, DEC is scalable and can handle large-scale datasets, making it suitable for real-world applications with high-dimensional and complex data. This enables a more accurate and nuanced understanding of the factors influencing optimal ambulance positioning. The DEC-AE approach also incorporates clustering algorithms, facilitating the identification of clusters or groups of similar patterns within the data [25]. This allows for the identification of hotspot areas with higher accident probabilities or specific risk profiles, aiding in the strategic placement of ambulances to minimize response times and maximize coverage. Additionally, this method has the potential to accommodate diverse data sources, including traffic accident data, road segment characteristics, weather conditions, and other relevant factors. By considering multiple data dimensions, the approach can provide a holistic view of the problem, enhancing the precision and effectiveness of ambulance positioning strategies.
The dataset includes information on traffic accidents that occurred, road segment information, and weather details of Nairobi, Kenya. Performing Exploratory Data Analysis on the dataset of the road surveys, and weather dataset, the paper identifies possible features and attributes affecting the accidents and patterns of risk across the city. To preserve such relationships and patterns of the data we apply a deep learning-based embedding approach called Cat2Vec while converting categorical attributes in the data pre-processing stage. To validate the predicted locations using DEC, the distance from that crash site to the nearest ambulance locations predicted is calculated using a novel Distance Scoring Algorithm. For further evaluation of the algorithm, different clustering metrics have been used and compared with other traditional clustering algorithms.
The proposed methodology in this paper addresses the following aspects: • Exploratory Data Analysis (EDA) is performed on the real-time accident dataset through which the potential features and attributes which contribute towards accidents and patterns across the city are identified.
• A clustering-based approach using Deep Embedded Clustering (DEC) is developed to identify optimal ambulance positioning locations across Nairobi while 59918 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.
preserving the feature relationships and patterns using Cat2Vec deep learning-based embedding technique which facilitates more accurate clustering.
• A novel Distance Scoring method is developed to validate the DEC model which calculates the distance between crash-site and the nearest predicted ambulance location, thus providing a quantitative measure of effectiveness.
• The performance of the proposed framework is then evaluated with and without the feature selection techniques and compared with existing clustering methods using various clustering metrics, which further validates the effectiveness of the DEC model.
The rest of this paper is organized as follows. Sect. II is a detailed review about related works for the problem statement. In Section III the methodologies and materials used are described, Section IV discusses the experiments performed and results obtained from the proposed framework. The paper delivers the discussion and future scope in Section V.

II. RELATED WORK
Researchers around the world have done a lot of work related to the prediction of crash sites, factors affecting accidents, and choosing the ideal locations for the placement of the paramedic's team. The following literature review section presents methods from various research studies related to clustering techniques used for the optimal positioning of ambulance locations by implementing exploratory data analysis, machine learning and deep learning techniques. This section presents a summary of the background work performed by other scholars regarding the problem and the different clustering techniques and performances achieved with regards to accuracy and other evaluation metrics.
Assi et al. [8] and Xiong et al. [27] proposed Machine learning models for predicting accident vs non-accident patterns in crash sites using Gaussian Mixture models and SVM. They further predicted the severity of the crash injuries by clustering the crashes using fuzzy c-means, Feed Forward Neural Networks and SVM. Data analysis was performed to identify the features from the crash sites to provide inputs to the ML models. The models were evaluated using accuracy, sensitivity and precision. On comparing the models, fuzzy c-means algorithm provided greater accuracy than traditional k-means clustering and SVM models.
Ghandour et al. [9] and Tiwari et al. [10] developed an approach that uses a machine learning hybrid ensemble classifier derived from decision trees and MSO algorithm to identify risk factors that contribute to fatal road accidents. They utilized the Lebanese Road accident platform (LARP) dataset consisting of 8482 accidents and the fatalities occurred in the accidents. To evaluate the impact of the factors causing casualties in a road accident, they performed sensitivity analysis of the attributes. From the selected variables, seven of nine showed significant association to casualties. To evaluate the model performances the metrics used were F1 score, precision, AUC-PR curve and Cohen's Kappa.
Granberg et al. [11] developed a simulation based predictive model to gauge the emergency ambulance demand in an area using multivariate regression model. The data used for their genetic regression algorithm was collected from census survey of the year 2005 consisting of 2076 small areas. For each location, a distance matrix was developed and used as inputs to the genetic algorithm in order to identify 35 probable ambulance locations using R-statistics software. The proposed model favored a significant R2 value of 0.71 with multiple coefficients. This particular distance matrix based approach provided better results on comparing with the models using nave forecasting techniques. Clustering in machine learning has been explored pertaining feature selection techniques [12], [13], [14], distance functions and cluster validations. A derivative of the popular clustering methods are K-means and Gaussian mixture models. Even though the approach using distance functions was developed earlier, its application and popularity are limited by high dimensionality and dataset space. Cao et al. [16] and Moriya et al. [17] proposed approaches based on batch clustering, fuzzy c-means clustering, and K-means clustering with an FNMF matrix for clustering illustrating the correlation patterns of the initial data points. In both the approaches, the correlation among the crash locations are calculated followed by clustering of the said crash locations based on the factors responsible for the accidents.
Alkheder et al. [18] proposed an approach using decision tree classifier, MLP and Naïve Bayes to identify the significant attributes that impact the prediction of the severity of a road accident. On comparing different models, it was concluded that the decision tree classifier provided a better classification accuracy of 0.08218. The attributes such as year of accident, age, nationality, gender and the type of accident were more significant in determining the accident severity. Hashmienejad et al. [19] utilized decision trees and genetic algorithms to develop a prediction model for predicting the severity of the road accidents. The set of rules induced from the genetic algorithm approach were further provided as input to the decision tree models namely CART, C4.5 and ID3, also validated using the test dataset. The method employed provided an accuracy of 0.8820, recall of 0.889, f-measure of 0.887 and a precision of 0.885 which was better than the alternative methods used namely ANN, SVM, KNN and Naïve bayes.
Ghosh et al. [20] and Sasaki et al. [21] employed Bayesian networks (BN) approaches to develop models based on the relationship of the attributes which were represented as probability distributions. Bayesian Networks are used for identifying the factors responsible for road accidents and also predict the severity of the accidents. These papers also evaluated the sensitivity and specificity of the models along with MAE and RMSE to assess the performance of BSVR. Taamneh et al. [22] utilized Artificial Neural Networks (ANN) along with K-means to predict the severity of road accidents. Other machine learning models were also used to compare the accuracy of the proposed ANN model, concluding that the proposed model provided a higher accuracy of 0.746.
Dizaji et al. [23] and Tian et al. [24] used Auto-encoders to reduce the dimensionality for obtaining the features having higher impact on clustering. Following the dimensionality reduction, Kmeans is employed for clustering the features in groups. The approach employs auto encoders to obtain a representational structures of the locations, then neglects the decoder part to obtain a smooth model and finally adds the Kmeans layer over the encoder layer to obtain the final model. Although this approach uses a deep neural network for mapping the data points in feature space prior to the feature selection and cluster formation, the goals of these two separate processes are not optimized together. Alqahtani et al. [25] proposed an approach using embedded clustering layer in deep auto-encoders. When compared to traditional clustering methods, this technique learns the feature representations and assigns clusters concurrently through deep auto encoders. During the optimization phase, the cluster centers are reassigned to all the data points which are accident locations in this particular problem. Following this, the cluster centers are updated iteratively in order to obtain the final stable clusters and better optimized performance. Table 1. provides the concise description of the survey conducted on existing methodologies along with the evaluation metrics used.
The existing literature analysis reveals several technical gaps that have prompted the development of our novel research endeavor. Traditional methods of representing categorical data, such as one-hot encoding or numerical encoding, fail to capture the inherent relationships between categories. This limitation results in a loss of valuable information and diminishes model performance, potentially leading to misinterpretations of results. Furthermore, existing research works primarily focus on cluster dynamics. While these metrics like point distance, inter and intra-cluster similarity, and dispersion provide valuable insights into the structure and quality of clustering algorithms, they alone are not sufficient for evaluating the effectiveness of models in real-time data scenarios. The limitations arise from the fact that these metrics primarily focus on geometric properties and overall cluster characteristics, rather than capturing the specific requirements and dynamics of real-time data and may overlook crucial performance aspects related to real-time data, leading to an incomplete assessment of the model&#39;s effectiveness. In the existing works, there is a gap in considering real-time or dynamic data streams, such as live traffic updates, weather conditions, or accident reports, which could significantly improve the accuracy and responsiveness of the models. The identified gaps highlight the necessity for new approaches and methodologies that investigate the interrelationships among categories and address the limitations observed in the current body of knowledge.

III. STUDY AREA AND MATERIALS
The problem of optimal ambulance positioning is addressed by utilizing real-time crash data from Nairobi City along with additional datasets of real-time road and weather conditions of the crash locations. The identified problem of finding optimal ambulance position is regarded as a clustering problem. By leveraging the combined datasets, the proposed study aims to conduct experiments and analysis to identify city-wide risk patterns and factors that contribute to road accidents in Nairobi. The analysis will involve exploring the relationships between various attributes and features within the datasets to uncover the underlying patterns and correlations. This information will aid in understanding the dynamics of accidents and their associated risks across different areas of the city. The study utilizes advanced machine learning and clustering techniques to analyze the data and identify optimal locations for positioning ambulances. By considering factors such as accident frequency and geographical conditions the study aims to develop a model that can suggest strategic ambulance placement across Nairobi. This approach will help emergency response services improve their efficiency and effectiveness in providing timely medical assistance to accident victims.

A. DESCRIPTION OF THE DATASET
The Nairobi City Accident Dataset includes accidents that have been reported up to 2019.It also consists of supplemental data like road survey data, and weather data. The data collected for the Nairobi City Accident Dataset is acquired in real-time, ensuring its timeliness and relevance. The proposed study utilizes all the mentioned datasets to conduct the experiments and identifies city-wide risk patterns and factors responsible for road accidents. Fig 1. Depicts the intensity of road accidents through a heat map at different coordinates in Nairobi City as a map view. The dataset was developed to identify the accident locations in 2018 and 2019 to predict potential factors of road accidents and is categorized into accidents, road details, and weather data. The accident data contains 6318 instances with 3 characteristics namely the Datetime, Latitude, and Longitude of the crash sites. The road segment dataset consists of 792 Instances with 4 characteristics including road segment id, road name, sides of the road, and POINT geometry coordinates of the road segments. The weather data contains 728 Instances with 7 characteristics including Date, precipitation, relative humidity, specific humidity, temperature, u component, and v component of wind velocity. Table 2. gives a detailed overview of the attributes in the accident, road information, and weather dataset. Some of these attributes were measured at the traffic accident level, while the others were measured as road properties and environmental data.

B. DATA ANALYSIS
Unlike preliminary information evaluation, exploratory data analysis (EDA) is a method of reading information units to summarize their primary characteristics, frequently with visual methods [29]. Many EDA strategies are followed in big information analytics. In this section, the paper tries to discover the patterns and possible factors influencing road accidents in Nairobi city via exploratory data analysis. The time span of experimental information is from January 2018 to December 2019. Through EDA, it became evident that road accidents follow a distinctive trend where factors like the hour of the day, the month of the year, and the days of the week impact the number of accidents to a certain extent.  Table 3 represents the attributes generated from the original dataset after data manipulation and their summary statistics. This obtained dataframe is utilized as the final input of the proposed model in further sections of the paper.

1) ACCIDENTS DATA
On performing exploratory data analysis on the accidents dataset, the road crashes showed trends and patterns which were useful if included in further modeling. Fig 2 and 3 represent the car crashes on an hourly and monthly basis from 2018 and 2019. It can be concluded that the maximum number of accidents occur between 6:00 am to 7:00 am. Although the traffic is less at that time, people Overspeed due to empty  roads, causing more accidents. From that monthly data, it can be seen that accidents mostly occur in the months of March and May which is the rainy season in Nairobi. Fig 4. Shows that the number of accidents occurring on weekends is quite less as compared to the accidents occurring on weekdays. Fig 5. Represents the crash sites on a weekly basis. Maximum accidents occur in the region −1.55 to −1.05 latitude and −3.05 to −0.57 longitude region with a count of 6070 accidents. This location is very near the center of the city.

2) WEATHER DATA
On considering the weather factors namely precipitation, humidity, temperature, and wind velocity associated which contributes to road accidents, the precipitation intensity was found to be the most important factor. Table 4  occur during high rainfall as the roads become slippery and visibility decreases.
From the weather data analysis, the following inferences can be made which are listed in Table 5.

3) ROAD SEGMENTS DATA
Apart from the accident locations and weather conditions, road accidents also depend on the type and location of the roads. It was found that the number of accidents was significantly high on single-lane roads rather than the two-way roads. The maximum number of accidents occurred on the Waiyaki way-trunk street which is a one-lane road and also closer to the city center.
The real-time nature of the data collection is facilitated by utilizing various instruments and sources. Speedometer data, obtained from vehicles or traffic monitoring systems, provides up-to-date information on vehicle speeds and traffic conditions. Satellite images, which offer a comprehensive view of the road network, are regularly captured and updated to reflect the current state of the city's infrastructure. Weather data, obtained from the weather department, ensures that the environmental conditions associated with the accidents are accurately captured and analyzed.

IV. METHODOLOGY
This paper proposes an approach (optimal ambulance positioning framework) for the automatic placement of paramedic help using Deep Embedded Clustering (DEC). To ameliorate the classification accuracy, this study utilizes Cat2vec(a deep learning-based model) to represent high cardinality categorical variables using low-dimension embedding while VOLUME 11, 2023 59923 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.  preserving the relationship and patterns obtained through exploratory data analysis between each of the categories. This study employs K-fold cross-validation for dividing the dataset into training and test sets.

A. Cat2Vec
Cat2Vec is a deep learning-based method of learning distributed representation for multi-field categorical data. Using Cat2Vec a low-dimensional continuous vector is automatically learned for each category in each field [30]. In simpler terms, Cat2Vec is a use of deep learning for creating embedding for categorical variables of tabular data. The use of embedding for categorical variables allows for capturing the relationship between categories. As shown in section III-B road accidents follow a distinct pattern affected by factors like an hour, month, or day. While working with such categorical variables researchers usually use traditional transformations like one-hot encoding, binary encoding, etc. However such transformations fail to capture relationships between categories.
Through data analysis, it was very evident that weekdays show more accidents than weekends or that the seasonal patterns of each month affect the number of accidents occurring. To ensure the most promising results the preservation of such relationships among categories while applying transformations during the pre-processing stages should be maintained. Embedding after applying Cat2Vec in our proposed framework helps capture these rich relationships and complexities.
This study uses Cat2Vec for all selected categorical features, the model consists of a perceptron network with a dense layer network and the chosen activation function is 'relu' and 'Adam' optimizer with a mean square loss function. The neural network learns the best representations for each category during the training phase to preserve the 59924 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.       crashes occurring throughout the week obtained from Data Analysis of the given dataset. Fig 10 shows the embeddings of the weekday attribute obtained through Cat2Vec.One can clearly understand that the Cat2Vec model preserves the relationship between each category and hence extremely helpful for the proposed work, that demands pattern identification and understanding for prediction. The same model is applied to other categorial variables present in the dataset i.e., months and hour of day.

B. DEEP EMBEDDED CLUSTERING
Deep embedded clustering (DEC) is an unsupervised clustering algorithm using deep neural networks [31] that utilizes and auto encoder configure the attributes of the initial data and then form clusters. Deep embedded clustering (DEC) has been attracting attention due to its efficient performance in the end-to-end clustering problems. The proposed study employs a deeply embedded clustering (DEC) method to identify VOLUME 11, 2023 59925 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.  While dealing with the dataset few missing values were discovered. In order to deal with this problem a mean fill approach is used to impute the missing values. The missing values are imputed with the row average. The next step after data imputation in data preprocessing is attribute conversion. Attribute conversion is applied if the attribute type 59926 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.  is categorical. To emphasize the impact of transformation techniques used on categorical variables and how the choice of transformation can show noticeable changes in model performance this paper conducts research in 2 phases. Phase 1 is applying traditional transformation like one-hot encoding in attribute conversion for categorical variables and Phase 2 is using Cat2Vec, a deep embedding-based approach for attribute conversion.

2) FEATURE SELECTION
The primary objective of Feature selection is to identify the most significant feature set that enhances the creation of models. For unsupervised ML problems such as clustering, filter methods procures the fundamental properties of the attributes which is evaluated using univariate statistics instead of cross-validation performance. Information gain calculates the reduction in entropy from the transformation of a dataset [32]. The strategy is employed for feature selection by evaluating the data gain of every variable within the context of the target. In the proposed method, information gain is calculated for all the attributes of the input dataset with respect to the initial clusters of k-means clustering. Fig 13 displays the bar graph for the information gain of each attribute in the dataset. Based on the results obtained, the 10 best features are selected for further processing steps.

3) MODELLING
Section 3.4 mentions that the last step while applying the DEC model is using a custom clustering layer with K-means. It is important to rescale the features in the range [0,1] since K-means uses Euclidean distances as a similarity measure which makes it sensitive to the scale of its features. Min-Max Scaler is used in the proposed work for Normalization. The scaled and transformed dataset is then used as input for the deep embedded clustering model (DEC). The DEC model predicts 5 clusters over the city, whose centroids are considered as the predicted ambulance locations. Choosing the number of ambulances required for each city or area involves decision-making on different levels. In this study, the number of clusters chosen which in terms determines the number of ambulance locations has been determined using both statistical and real-time logical facts.
Considering the use of the elbow method and silhouette method to establish the ideal number of clusters, from   it is evident that the elbow occurs at k=3, but Van Essen et al. [33] shows that the number of ambulances in a city is also dependent on the factors like the accident occurring per second, the range of area of the accidents, and the demand of ambulances. Based on the Nairobi dataset, and keeping the above-mentioned factors in consideration the number of clusters determined was five which is also the second elbow in Fig 15. The experiments are conducted using K-Fold cross-validation with two different K values, 10 and 30.The semantic view of the proposed ambulance positioning system is presented in Algorithm 1.

V. EXPERIMENTS AND MODEL EVALUATION
Experimental Setup: This section discusses the results from the analysis of the Nairobi City Accident dataset using the proposed ambulance positioning system. The Python 3.8 platform was taken into account with certain fundamental packages like NumPy, scipy, and matplotlib and data-analysis packages like Keras, scikit-learn, and TensorFlow for the implementation of different algorithms, data analysis, and prediction. The study uses an i7 core CPU running at 3.4 GHz and 8 GB of RAM to conduct all experiments To validate the experiment, the proposed work the suggested work is compared with state-of-the-art clustering algorithms like K-Means, Gaussian Mixture Model, and Agglomerative clustering.

A. PERFORMANCE ANALYSIS METRICS
In this research work 4 evaluation and performance measures including Silhouette Score, Davies-Bouldin Index,, Calinski-Harabasz Index and a novel scoring measure have been used to compute the efficacy of the proposed model.

1) SILHOUETTE SCORE
The Silhouette Score is a very helpful tool to prospect the similarities and differences within and across clusters visually by measuring the separation distance between the clusters. It ranges from [−1,1] and shows the proximity of each point in a cluster to the points of the neighboring cluster. Values closer to +1 i.e higher Silhoutees Coefficients indicate the cluster's sample is further away from the neighboring clusters' sample. The formula used to calculate the Silhouette Score is: (a, b) where a = mean intra-cluster distance b = mean nearestcluster distance

2) CALINSKI-HARABASZ INDEX
Calinski-Harabasz Index is a great tool for evaluating the performance of clustering algorithms as the a-priori 59928 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply. knowledge of ground truth label information is not required, which suits the proposed study where the ground truth labels are not available. C-H index is a ratio between the within-cluster dispersion and the between-cluster dispersion. A higher C-H index indicates a better performance.
The formula used to calculate the CB index is: Here tr(B k ) represents the trace of the between-group dispersion matrix and tr(W k ) represents the trace of the within-cluster dispersion matrix defined by:

3) DAVIES-BOULDIN INDEX
Like C-H index Davies-Bouldin Index does not require a ground truth label. It is an average similarity measure of each cluster with its most similar cluster wherein the similarity defines the ratio of within-cluster distances to betweencluster distances. A lesser score results in better performance as it shows that the clusters are less dispersed and further apart from each other. This way, clusters that are less dispersed and farther apart will provide a better score. The formula used to calculate the DB index is: where,     The above classification metrics evaluate cluster dynamics like the distance between cluster points, inter and intra-cluster similarity, and dispersion but do not evaluate how well the proposed model works in a real-time simulation. The problem of finding optimal locations to place the ambulances can only be resolved if the response time and distance between ambulance and crash sites are assessed. Since the above evaluation metrics fail to measure any such parameters, the novel scoring function introduced solves this issue. It calculates the average separation distance between crash sites and predicted centroids using Euclidean distance. With a higher score indicating greater performance, it shows how close each point in a cluster is to the predicted cluster centroid. Shown below is the algorithm used as the novel scoring function.

B. WITHOUT Cat2Vec CATEGORICAL EMBEDDING
In this section, the results after pre-processing the data without deep encoding on the Nairobi city accident dataset are described. The acquired results are based on the average   findings from the test data set for each fold after applying 10 and 30-fold cross-validation to each model. Table 6 reports the comparison of individual classifiers including KMeans, DEC-AE, and Gaussian Mixture Model with the proposed deep-embedded clustering framework. It shows how the proposed model proves to give better performance when compared with standard clustering algorithms. Table 6. Shows the performances of different clustering algorithms used for the said problem. In order to measure the efficiencies, cluster scoring metrics namely Silhouette score, novel distance score, Davies Bouldin score, and Callinski Harbasz score have been applied. The DEC-AE performs consistently well in all the scoring criteria giving a silhouette score of 0.1960, distance score of 7.325, Davies Bouldin score of 1.472, and Calinski Harbasz score of 2195.50.

C. With Cat2vec FOR CATEGORICAL EMBEDDINGS
The aim of this approach is to emphasize that using the Cat2vec model for transforming categorical variables to deep embeddings can enhance the performance of the positioning framework and corroborate its effect on optimizing ambulance locations. The Cat2vec model preserves the relationship between the categories and feeds the dataset with the patterns identified in data analysis to the DEC model. The performance of the model using Cat2Vec for categorical transformations to deep embedding and then feeding the dataset along with the deep embeddings to the DEC model are detailed in this section. To verify its supremacy, 10 and 30 cross-validations is employed to assess performance. The below-given Table 7. Depicts the performances of different clustering algorithms used for the said problem. In order to measure the efficiencies, cluster scoring metrics namely Silhouette score, novel distance score, Davies Bouldin score, and Callinski Harbasz score has been applied. The DEC-AE performs consistently well in all the scoring criteria giving a silhouette score of 0.4853, distance score of 7.581, Davies Bouldin score of 2.523, and Calinski Harbasz score of 500.29. The results demonstrated that Cat2vec helps significantly in increasing the efficiency of the model. For the evaluation of the homogeneity and completeness of the clusters calculated, V-measure is used as a scoring function k-cross validation for both with and without Cat2Vec embeddings. The main advantage of using V-measure is that this evaluation metric is independent of the number of clusters, the number of data points in each cluster as well as the number of class labels of the dataset. Hence, it makes this metric very suited for the given problem. Table 8. depicts that the DEC-AE has reached the maximum score of 0.95 with k-fold cross-validation accuracy, showing that the predicted position for ambulance locations will help the paramedics reach the crash site faster resulting in lesser casualties. Fig 15 and Fig 16 supports the evidence that on applying Cat2Vec embedding, the clusters obtained are much more compact and clear in comparison to those without the embeddings. Table 9. Accounts for the optimal coordinates obtained to position the ambulances in Nairobi city after applying DEC-AE with Cat2Vec embeddings.
The latitude and longitude represent the optimal positions in the city from where paramedic help can easily reach the crash locations in minimum time and thereby reducing road accident fatalities.

VI. CONCLUSION
Over the past 20 years, methods for identifying accident hotspots and determining optimal paramedic positions have evolved and now plays a significant role in the successful implementation of traffic safety management programs. This study aimed to develop and compare models for predicting optimal locations for positioning ambulances in Nairobi city, based on the Nairobi accidents dataset from 2018 to 2019. The final model utilized the Cat2Vec model for converting categorical data to numerical data in the form of embeddings for respective categorical attributes. Following data preprocessing and feature selection, a clustering-based approach was followed using Deep Embedded Clustering along with standard machine learning algorithms like K-Means clustering, GMM, and Agglomerative clustering to identify five clusters, the centroids of which provided the optimal ambulance positions. In order to evaluate the clustering algorithms, performance metrics including the Silhouette score, Calinski-Harbasz score, Davies Bouldin Score, and V-measure were used. To evaluate the distance of the centroid and the predicted ambulance locations, a novel scoring method namely Distance score was implemented. Among the developed model the DEC-AE model with Cat2Vec embeddings provided the highest accuracy of 95% in k-fold crossvalidation. The distance score of 7.581 for the DEC-AE model which is higher than standard machine learning algorithms depicts that the distance between possible crash locations and ambulance positions is minimum. The analysis of various clustering metrics mentioned above reveals that the proposed DEC-AE model consistently outperforms other models in terms of clustering performance. This finding highlights the effectiveness and robustness of the DEC-AE model in accurately clustering the data and capturing underlying patterns. The study will advise decision-makers on where best to invest or implement security measures.

VII. FUTURE SCOPE
The study on predicting optimal ambulance positions in Nairobi using DEC has opened up several avenues for future research. Firstly, the dataset used in this study can be enhanced by including additional variables such as road type, road construction, speed limit, accident severity, driving behaviour, and road conditions that were absent due to data scarcity. The incorporation of these variables would provide a more comprehensive understanding of the factors influencing accident occurrences and improve the accuracy of ambulance positioning models. Additionally, expanding the analysis period beyond the limited years of 2018 to 2019 would allow for the identification of temporal trends and patterns in accidents. A longer time span would capture seasonal variations, changes in traffic patterns, and the impact of evolving road infrastructure or safety measures. Including cities with varying levels of urbanization and traffic conditions would help understand how the models perform in diverse settings. This longitudinal analysis can provide valuable insights into the effectiveness of safety measures, policy interventions, and changing patterns of road accidents.
Furthermore, conducting comparative studies using datasets from other cities, particularly in different socioeconomic contexts, would provide insights into the generalizability and robustness of the proposed approach. It would allow for a more comprehensive understanding of the factors that contribute to accidents and their variations in different settings. Moreover, further analysis is recommended to examine trends in accidents over time. In this regard, the use of time series analysis is recommended. Integrating real-time data feeds, such as traffic flow, weather updates, and accident reports, would further enhance the responsiveness and adaptability of ambulance positioning models. By incorporating live data streams, the models could dynamically adjust ambulance positions based on changing traffic conditions, accident hotspots, and real-time demands.