## 3 Materials and Methods
### Multi-Scale Positioning for Waypoint Navigation  
This section introduces the detailed path planning process of our HDPP. In order to accurately distinguish the different types of feature points in the forward road, thereby distinguishing road sections and roadblocks to further correct the gait, we propose to perform multi-scale positioning on the input image through iterative refinement. The impact caused by the misidentification of obstacles will cause unpredictable damage to the equipment, so it is necessary to accurately identify the obstacles and pathways in the receptive field. We perform multi-scale fusion and regional supplementation on the receptive field image. The framework of this approach is shown in Figure 2. First, we fill the image collected by the robot for contour filling to prevent the loss of boundary information. \[X^{\prime\prime}=drawContours(X,k^{(..)}) \tag{1}\]  
\(k\) is the image contour filling operator. There are two contour matrices in this algorithm, focusing on patch and image, respectively. \(X\) is the input image, while \(X^{\prime\prime}\) is the filled result. Next, we input the filled result \(X^{\prime\prime}\) into the 2-channel feature extraction pyramid network and, respectively, obtain 5 different-sized corner feature maps {C1, C2, C3, C4, C5} for obstacles and path information. The features contain various categories of waypoints, such as road boundary, road center, close to obstacle etc. Then, we segment the two-channel multi-scale feature maps separately to obtain different a priori boxes and position predictions for each contour. These feature maps contain both strongly represented semantic information and geometric details. We will accomplish multi-scale feature fusion in a serial multi-branch structured feature pyramid, mainly through layer-hopping connections. We return the feature rescaling obtained at low scale (for example, {C1, C2, C3}) to the high scale feature layer (for example, C4) by weighted averaging to improve the feature resolution. In addition, Gaussian non-local attention is used to increase the features. Residual connectivity will also be used in the information integration calculation for multi-scale fusion. This process is described in detail in the pseudo-code of Algorithm 1. In order to improve the model representation ability, we obtained multiple results through multiple rounds of cross fusion to prevent performance degradation caused by interference. After obtaining high-level and detailed information, instance-level segmentation and position are performed on the image, which means that we can obtain pixel positions for obstacles of different sizes. The gradient of one iteration cannot accurately reveal the actual position and contour size of the obstacle, so we repeat the positioning until all target predicted positions in the receptive field are not changing to obtain a stable and reliable gradient heat map to obtain the initial positioning. \[F_{*}(p)=w_{*}^{\intercal}\phi_{S}(p) \tag{2}\]\(F_{*}(p)\) is the predicted position coordinate, \(\varnothing_{S}(P)\) is the feature vector of the position, where \(p\) represents the region proposal, \(w_{*}\) is the matrix consist of HDPP's parameters for positioning. And the loss function and optimization objective are as follows:  
\[Loss=\frac{n}{i}(t_{*}^{i}-\hat{w}_{*}^{T}\phi_{S}(P^{i}))^{2} \tag{3}\]  
\[\omega_{*}=\text{argmin}_{w_{*}}\frac{n}{i}(t_{*}^{i}-\hat{w}_{*}^{T}\phi_{S}( P^{i}))^{2}+\alpha\|\hat{w}_{*}\|^{2} \tag{4}\]  
Here our _Loss_ uses L2 loss, where \(t_{*}^{i}\) represents the true value and \(\hat{w}_{*}^{T}\varnothing_{S}(P^{i})\) is the predicted result. \(w_{*}\) is our optimization goal, which can be solved by gradient descent or least square method. Moreover, \(n\) is the total number of iterations in the actual runtime (the upper limit of iterations \(Max\_I\) is designed to be 3000 in this paper) We also introduce a regularization term \(\alpha\|\hat{w}_{*}\|^{2}\) in order to prevent overfitting, which is the parameters of FCN.