# Emergency Evacuation Simulation Study Based on Improved YOLOv5s and Anylogic
## 3 Analysis of Experimental Results  
### YOLOv5s-SE Based Target Detection Model  
Firstly, we produced a pedestrian head detection dataset by field photography and network collection and collected a total of 4405 valid images, which were allocated to the training and validation sets according to a ratio of 80%, of which 3352 images were used for the training set and the remaining 882 images were used for the validation set. The dataset images are shown in Figure 4. \begin{table}
\begin{tabular}{c c} \hline
**Module Name** & **Description** \\ \hline PedSource & Generate pedestrians, and by setting parameters, pedestrians entering the building can be simulated \\ PedService & Pedestrians will receive services at service points to simulate \\  & security checks, ticket purchases, and other actions \\ PedGoTo & Guiding pedestrians to designated areas \\ PedWait & Directs pedestrians to designated areas and sets waiting times \\ PedEnter & Pedestrian entry module, which can simulate pedestrian entry \\  & from other floors or areas \\ PedExit & Pedestrian departure module, which can simulate the departure \\  & of pedestrians from the current floor or area \\  & Indicates the end of pedestrian flow, simulating pedestrians \\ Pedsink & leaving the current scene \\ \hline \end{tabular}
\end{table} 
Table 1: Introduction to Anylogic’s common pedestrian library modules. Figure 3: Subway station layout map. After determining the dataset, the images were next annotated one by one. The annotation principle was to annotate all the human head regions within the images as much as possible, and finally, the annotated dataset was imported into the network models of YOLOv5s and YOLOv5s-SE for training, after which the training models were obtained. We used the trained models to detect and validate the new images and randomly selected two maps of pedestrian head detection results from underground stations, as shown in Figure 5.  
By analyzing Figure 5, we can obtain that YOLOv5s-SE can detect the head of a pedestrian relatively accurately in a dense crowd in an underground station, despite a large number of people and the relatively dense pedestrian population, and has a low miss detection rate, possessing ideal detection results. To further validate the performance of the model, this paper evaluates the trained network model by generally selecting the evaluation metrics of precision (\(P\)), recall (\(R\)), average precision (\(AP\)), and mean accuracy (\(mAP\)) [36]. The precision and recall are calculated as follows:  
\[Precision=\frac{TP}{TP+FP}\times 100\% \tag{1}\]  
\[Recall=\frac{TP}{TP+FN}\times 100\% \tag{2}\]  
where \(TP\) denotes the number of correctly detected targets, \(FP\) denotes the number of incorrectly detected targets, and \(FN\) denotes the number of undetected samples. The accuracy-recall relationship based on the YOLOv5s-SE target detection model can be obtained by using equation. The precision-recall curve of the YOLOv5s-SE target detection model is shown in Figure 6.  
Figure 4: Dataset images. Figure 5: Graph of test results for YOLOv5s-SE. By analyzing Figure 6, it can be found that the area under the precision-recall curve based on the YOLOv5s-SE target detection model can reach 0.958, which is a more desirable figure and proves that the model possesses high precision. In addition, the mean accuracy mean of the YOLOv5s-SE target detection model is obtained in this paper, and the mean accuracy mean is the average of multiple class APs. The mean accuracy and mean precision are calculated as follows:  
\[AP=\int_{0}^{1}P(R)dR \tag{3}\]  
\[mAP=\frac{\sum PA}{NC} \tag{4}\]  
The \(mAP\) is one of the most important metrics in target detection algorithms, and its value is always in the interval [0, 1]. [EMAIL_ADDRESS] is the average accuracy (IoU = 0.5), i.e., the average \(AP\) of all images under each category is calculated when the threshold IoU is set to 0.5.