# Autonomous Obstacle Avoidance with Improved Deep Reinforcement Learning Based on Dynamic Huber Loss
## 4 Experimental Setup and Simulation Analysis
### Analysis of Test Results
In contrast, Smooth L1 loss, Huber loss, and Dynamic Huber loss corresponded to success rates as high as 97.40%, 98.70%, and 98.85%, respectively, which indicates that the UAV accurately identifies and avoids static obstacles. When the environment switches to dynamic, the UAV's response lags due to the difficulty of adapting the Hard update to the dynamic changes promptly, resulting in a generally poor success rate for each loss function under the Hard update. After switching to the Soft update, the situation improves and the success rate of each algorithm increases, and the success rate of Dynamic Huber loss increases to 74.21%, which highlights the dynamic adaptability of Soft update. Wind interference increases the complexity of the UAV obstacle avoidance environment, and the success rate of all loss functions is affected to a certain extent, while the success rate of Dynamic Huber loss can still reach 70.95%, which indicates that it has a strong anti-interference ability. In summary, the Soft update and Dynamic Huber loss have strong dynamic adaptability and anti-interference capability, which can quickly weigh the dynamic pros and cons and guide the UAV to successfully avoid obstacles. From the data in Table 5, it can be seen that the average path length of MSE with the Soft update method is as high as 408.92 in static environment, which indicates that in the static scenario, the UAV's mishandling of the static obstacle locations and surrounding information leads to the UAV making the path too long due to frequent detours. The average path lengths of Smooth L1 loss, Huber loss, and Dynamic Huber loss are 12.34, 11.17, and 10.73, respectively, with Dynamic Huber loss performing the best. This is an indication of its ability to accurately weigh the relative relationship between the obstacle and the UAV during the loss calculation process and to guide the UAV to choose a shorter and safer path around the static obstacle with a more reasonable decision. In the dynamic environment, the average path length of each loss function based on Hard update is relatively long. Its difficulty in responding quickly to changes in the dynamic environment leads to creating ineffective movement and, thus, path growth. After switching to Soft updating, the situation is significantly improved, the path length of each algorithm decreases, and Dynamic Huber loss decreases to 37.04. In the dynamic environment with wind interference and the Soft update, the average path length of each loss function increases, but the Dynamic Huber loss remains relatively low at 40.04. Wind interference increases the complexity and uncertainty of the environment, which poses a greater challenge to UAV path planning, and Dynamic Huber loss can maintain a shorter path in such a complex environment, which indicates that it has a stronger anti-interference ability and environmental adaptation ability. In conclusion, Soft updating can adjust the UAV's path planning according to the motion state of the dynamic obstacles promptly by its good dynamic adaptability. Based on this, Dynamic Huber loss further optimizes the decision-making process by efficiently capturing and accurately calculating changes in the dynamic environment, enabling the UAV to shorten its flight path to the maximum extent possible while ensuring safe obstacle avoidance, significantly improving its efficiency and performance. Figure 7: UAV flight path diagrams during testing ((**a**) shows the paths in a static environment with different loss functions under Soft updates; (**b**) presents those in a dynamic environment with different loss functions under Hard updates; (**c**) depicts the paths in a dynamic environment with different loss functions under Soft updates; (**d**) represents the paths in a dynamic environment with different loss functions under Soft updates and wind interference).