# Visual SLAM Mapping Based on YOLOv5 in Dynamic Scenes
## 4 Method Validation  
In this paper, the accuracy of this algorithm in a dynamic environment is tested with three datasets: fre3_walking_xyz, fre3_walking_halfsphere, and fre3_walking_static. The trajectory map results obtained by this algorithm are compared with those obtained by the ORB-SLAM2 algorithm and DynaSLAM algorithm, and the processing time for each frame is compared with that of DynaSLAM. The advantages and disadvantages of this algorithm in terms of accuracy and real-time performance are summarized and analyzed. In this paper, we use the Relative Pose Error (RPE) and Absolute Trajectory Error (ATE) evaluation metrics to evaluate the mapping accuracy of SLAM systems. Usually, when evaluating map construction accuracy, it is more intuitive to compare the results by observing the map construction, but such observation results can only describe in general terms whether a certain algorithm is relatively accurate with respect to map construction. Therefore, in order to calculate the accuracy of map construction more accurately, researchers generally use errors to estimate the accuracy of map construction. In this paper, the accuracy of map construction is expressed by calculating the magnitude of Root Mean Squared Error (\(RMSE\)) with the following formula:  
\[RMSE(E_{1:n},\Delta)=\left[\frac{1}{m}\underset{i=1}{\overset{m}{\underset{i= 1}{\overset{m}{\underset{i=1}{\overset{m}{\underset{i=1}{\sum}}}}}}}\left\|trans(E_{i}) \right\|^{2}\right]^{1/2} \tag{15}\]  
where \(trans(E_{i})\) denotes the error at moment \(i\), \(E_{1:n}\) denotes the camera pose from \(1\) to \(n\), and \(\Delta\) denotes the fixed time interval. The calculation method of performance improvement in this paper is shown in Equation (16):  
\[\eta_{RMSE}=\frac{\eta_{os2}-\eta_{our}}{\eta_{os2}}\times 100\% \tag{16}\]  
where \(\eta_{os2}\) represents the \(RMSE\) of the ORB-SLAM2 algorithm and \(\eta_{our}\) represents the \(RMSE\) of the OurSLAM algorithm. \[\eta_{SD}=\frac{\eta_{cs}-\eta_{co}}{\eta_{cs}}\times 100\% \tag{17}\]  
where \(\eta_{cs}\) represents the \(SD\) of the ORB-SLAM2 algorithm and \(\eta_{co}\) represents the \(SD\) of the OurSLAM algorithm. In the experiments for this paper, the values of ATE and RPE are used to reflect the results of the map construction accuracy of the algorithm in this paper. The values of RPE and ATE are used in the calculation of the evaluation parameters \(RMSE\) and Standard Deviation (\(SD\)). Since \(RMSE\) is more sensitive to outliers in the data and can be observed more intuitively by deviation, the robustness of the system is described by using \(RMSE\) in this paper. In response to the degree of dispersion of the camera trajectory, this paper uses the standard deviation for judgment, which can describe the stability of the system more clearly, as shown in Tables 1 and 2. In Tables 1 and 2, the \(RMSE\) and \(SD\) results obtained by the proposed algorithm and ORB-SLAM2 algorithm are compared and analyzed, and the performance improvement of the proposed algorithm compared with the ORB-SLAM2 algorithm is obtained. As can be seen from Table 1, in terms of the comparison results of absolute trajectory errors, the \(RMSE\) of the proposed algorithm is 97.8% higher than that of the ORB-SLAM2 algorithm, and \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Datasets**} & \multicolumn{2}{c}{**ORB-SLAM2**} & \multicolumn{2}{c}{**OurSLAM**} & \multicolumn{2}{c}{**Performance Improvement\%**} \\ \cline{2-7}  & \(RMSE\) & \(SD\) & \(RMSE\) & \(SD\) & \(\eta_{RMSE}\) & \(\eta_{SD}\) \\ \hline fre3\_Warking\_xyz & 0.6395 & 0.3162 & 0.0139 & 0.0071 & 97.8 & 97.8 \\ fre3\_walking\_halfsphere & 0.6685 & 0.3385 & 0.0158 & 0.0153 & 94.6 & 95.5 \\ Fre3\_walking\_static & 0.4165 & 0.1742 & 0.0171 & 0.0043 & 94.8 & 97.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Absolute trajectory error comparison results (ATE).