# Faster R-CNN-LSTM Construction Site Unsafe Behavior Recognition Model
## 3 Network Model Based on Faster R-CNN-LSTM
### Test Process and Results  
In the training process of Faster R-CNN, SGD is typically employed as the optimizer, with an initial learning rate set at 0.001, momentum at 0.9, and weight decay of 0.0005. For the LSTM training, the Adam optimizer is commonly adopted, with an initial learning rate of 0.001, incorporating a dropout rate of 0.5 for model regularization. To prevent overfitting and ensure the timely termination of the training, the process is halted if the loss in the validation set does not show significant improvement over 20 consecutive epochs. This strategy ensures that the model achieves the optimal training results without compromising its generalization capabilities. The original Faster R-CNN-LSTM network framework and the improved Faster R-CNN network framework are trained using the safety helmet dataset under complex operation conditions. As shown in Figure 8, after the unimproved Faster R-CNN-LSTM network framework is iterated to 80,000 times, the loss value tends to converge, and the loss value is 0.8. The improved Faster R-CNN-LSTM network structure converges into 0.2 after 50,000 iterations. The improved network framework can effectively reduce the loss value and optimize the network structure. After the training is completed, the model accuracy of the two network frameworks is evaluated, and the best effect _MAP_ of the two algorithms is shown in Table 2.  
From the data presented in Table 2, we observe that the mean average precision (MAP) of the refined Faster R-CNN-LSTM framework surpasses that of the conventional CNN-LSTM framework by a significant 15%. The respective detection outcomes from both methods are further examined in Figure 9. In our experiments, the CNN-LSTM model detected four instances correctly with one instance misclassified, culminating in an average detection accuracy of 91.48%. Conversely, the enhanced Faster R-CNN-LSTM model demonstrated impeccable performance with a flawless detection rate, achieving a remarkable accuracy of 99.99%. These results substantiate the proficiency of the improved Faster R-CNN-LSTM framework, especially in recognizing small target helmets, thus underscoring its capability to bolster the overall network performance. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Methods**} & **Wear a Helmet** & **Not Wear a Helmet** & \multirow{2}{*}{_MAP_} \\  & \(\mathbf{AP}\) & \(\mathbf{AP}\) & \\ \hline CNN-LSTM & 0.7515 & 0.4878 & 0.6197 \\ Faster R-CNN-LSTM & 0.8084 & 0.7386 & 0.7735 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Model comparisons. Figure 8: Model loss comparisons. Further analysis of the model's recognition accuracy was conducted by comparing the recognition results in complex environments, as illustrated in Figure 10. The CNN-LSTM network framework detected five instances, exhibited one false detection, and had one miss. In contrast, the improved Faster R-CNN network framework showed no false detections or misses, indicating its superior recognition accuracy. As depicted in Figure 8, a comparison of the two models' recognition abilities can be observed with the individual on the far right of the image. The CNN-LSTM tends to misidentify individuals wearing regular hats as those wearing safety helmets. The enhanced model, on the other hand, exhibits a greater accuracy in recognizing the edge features of safety helmets, accurately determining whether individuals are donning safety helmets. Besides the baseline Faster R-CNN model, our research juxtaposes its performance against variants of the Faster R-CNN employing different feature extraction networks. Table 3 delineates the detection efficacy of these diverse extraction networks. Evidently, the network framework deployed in this study stands out, with a MAP score of 0.773, reflecting a commendable 15% augmentation when contrasted with the foundational network framework. Figure 10: Comparison of complex environment models. (**a**) CNN-LSTM. (**b**) Faster R-CNN-LSTM. Figure 9: Comparison of monitoring effects. (**a**) CNN-LSTM. (**b**) Faster R-CNN-LSTM.