# DWPIs: Dynamic-Weight Parallel Instance and Skeleton Network for Railway Centerline Detection
## 5 Conclusions  
In this work, which focuses on the task of detecting the centerline of a railway to guide UAV autonomous flight, this paper introduced the dynamic-weight parallel instance and skeleton network, which is an end-to-end multi-task branch method.  
* This paper proposed a novel network with two parallel branches, including an instance-segmentation branch and a skeleton-detection branch. The instance-segmentation branch is to determine the location of the railway, which is improved in the backbone and attention module. The skeleton-detection branch extracts the skeleton of the railway and is improved in the loss function and inference process.
* This paper designed a fused loss function with dynamically changing weights during the training process to change the dominant task. The weight of the instance-segmentation branch decreases from initially being large to extract the correct location. In contrast, the weight of the skeleton-detection branch increases from a very small value to being extremely close to one to focus on skeleton features.  
This paper compares the evaluation metrics of the following architectures: (1) the different backbones of the instance-segmentation network, skeleton-detection network and two-branches network, (2) with and without an attention module, (3) different parameters of fused loss function with dynamic weight, (4) with and without a threshold function in the inference procedure, and (5) with and without the instance-segmentation branch.  
Overall, experiments based on our own railway datasets taken in various places and times demonstrate that our network performs well in different environments. However, the skeleton results may be truncated when there is a dense occlusion in the field of view, which will influence the smoothness of the UAV's autonomous flight. Apart from this, the speed of the inference of our network may not meet the stringent requirements of real-time flight of lightweight UAVs. Considering the obscured railway and the complexity of network, there is still much room for improvement in both accuracy and speed in future work. To solve the issue of the truncated skeleton, future work can focus on two aspects: connecting the truncated parts utilizing the structure features of the skeleton in the post-process; and obtaining a complete skeleton directly through optimizing the network. To increase the speed of inference, the two branches can be merged in the bottleneck to decrease the complexity of network in future work.  
Conceptualization, X.L. and Y.G.; methodology, X.L. and Y.G.; software, X.L. and Y.G.; validation, X.L. and Y.G.; formal analysis, X.L. and Y.G.; investigation, X.L., Y.G. and H.Y.; resources, X.L. and Q.Y.; data curation, X.L., Y.G. and H.Y.; writing--original draft preparation, X.L. and Y.G.; writing--review and editing, X.L. and Y.G.; visualization, X.L. and Y.G.; supervision, X.L., Q.Y. and L.J.; project administration, X.L. and L.J.; funding acquisition, X.L. and L.J.; All authors have read and agreed to the published version of the manuscript. This research was supported by National Natural Science Foundation of China (No. 62033004).  
Not applicable.