## 2 Adaptive Spatial Feature Fusion Depth Completion
### Adaptive Spatial Feature Fusion Module  
In order to solve the accuracy problem of the classical algorithm Faster R-CNN [32] for small object detection in object detection, FPN [33] proposed a feature extraction method based on a feature pyramid network. Instead of limiting the extraction to feature maps at a single scale, the method divides the feature map into multiple scales and generates anchors of different sizes at each scale. Smaller objects on small-sized feature maps result in blurred features due to downsampling, when the receptive field can more easily focus on larger-sized objects. Conversely, on large-size feature maps, smaller objects have sharper textures, while larger objects tend to lose sight of the overall features due to excessive attention to detail, thus affecting their robustness. Feature pyramid networks work by corresponding the size of an object to the scale of the feature map. When an object of a certain size is associated with a feature map of a certain scale, the object is considered to be a positive sample; while on feature maps of other scales, the object is considered to be a negative sample. The reason for this is that if the object is detected in every scale of the feature map, it can easily lead to conflicting feature information between different scales. By building a feature pyramid network based on the above idea, the size of the object is effectively correlated with the scale of the feature map, thus improving the accuracy of small object detection. This method brings a new breakthrough in the research and application in the field of object detection, and shows good results in practice. Although we did not use a feature pyramid network to extract features, this study uses an encoder-decoder-type network and generates multi-scale feature maps at the decoder. Unlike the other depth completion methods mentioned in this paper, those methods only use the last layer of the feature map to generate the dense depth map, ignoring the potential value of feature information at other scales. Depth completion is different from object detection, but we can borrow ideas from objection detection. It is well known that objects at a distance are relatively small, while objects at close range are relatively large. In an autonomous driving scene, the top half of the depth map usually represents places far away from the camera and relatively small object contours, while the bottom half represents places closer to the camera and relatively large object contours. Inspired by it, we have introduced ASHF-ED module into DepthNet. This method extracts feature map information near the top pixels in larger-sized feature maps, and near the bottom pixels in smaller-sized feature maps. By adaptively fusing multi-scale features, we are able to enhance the completion of the contours when predicting depth, better understand the differences in features between near and far objects and improve the accuracy of depth information for small objects. For the above theory, we have three feature maps of different sizes, denoted \(Y_{1}\), \(Y_{2}\) and \(Y_{3}\), according to Figure 1. These feature maps have different resolutions and number of channels. To facilitate the computation, the ASHF-ED uses a \(1\times 1\) convolution kernel to modify the number of channels of \(Y_{1}\) and \(Y_{2}\), and uses the upsampling method to align the resolution of \(Y_{1}\) and \(Y_{2}\) with \(Y_{3}\). This results in the unified feature maps \(Y_{1\to 3}\) and \(Y_{2\to 3}\) after the channels and resolution modifications, representing the result of unifying the channels and resolution size with \(Y_{3}\). ASHF-ED is a method that obtains the final prediction by assigning weights to the pixel values of each input image and summing them together. The output of the adaptive feature module is set to be a dense depth map, where the \(i\)-th pixel is denoted as \(Y_{pred}^{i}\).