# Track Line Recognition Based on Morphological Thinning Algorithm +
###### Abstract
\[PEI=\frac{con(k\in Effective|\bigcup k)}{con(\text{Ground truth box})} \tag{1}\]  
where the ground truth box represents the true bounding box, _con_ represents the amount of information contained, \(k\) represents the pixels, Effective represents the effective pixels (i.e., the pixels contained in the target to be checked), \(\bigcup k\) represents the set of all pixels, _PEI_ represents the proportion of the effective information in the true bounding box (i.e., the proportion of pixels contained in the target to be checked and all pixels in the bounding box). As shown in Figure 2, the green rectangular box is the ground truth box. When the target to be detected is a person or signal lamp, _PEI_ > 0.5 will be more ideal for training and prediction using the method of object detection. When the target to be detected is a narrow track line, _PEI_ < 0.5 shows that the invalid information accounts for a large proportion in the ground truth box, which will cause great interference in later training and prediction, resulting in a poor final effect. Relative entropy (_KL_ divergence) is introduced to measure the difference between valid information and invalid information. As shown in Equation (2)  
\[D_{KL}(P||Q)=\sum_{i=1}^{n}P(x_{i})log_{2}(\frac{P(x_{i})}{Q(x_{i})}) \tag{2}\]  
where \(D_{KL}\) represents the relative entropy and _KL_ represents divergence which is used to measure the difference between valid information and invalid information. \(P(x)\) represents the distribution of valid information and \(Q(x)\) represents the distribution of invalid information. mation; the difference between them can be measured by _P(x)/Q(x)_, with \(i\) representing the random variable (1... _n_). If the ratio is 1, it shows that they are very similar. The greater the interference of invalid information on effective information, the relatively poorer the object detection. Rail line targets are relatively long and narrow. The straight parts are trapezoid in shape, with short upper and bottom edges and long lateral sides. The curved part presents various irregular shapes due to having different curvatures. The shape of the turnouts is more complicated and variable, and much redundant information exists. It is, therefore, difficult to use the corresponding labeling method of the object detection network for accurate data calibration; accordingly, the object detection method is less applicable to the track line detection problem. Real-time detection: Since the object to be detected may be located anywhere in the image, and the size of the target is uncertain, it is usually necessary to construct a feature pyramid of the detection image [7]. A picture passes through the feature pyramid (1\(\times\), 2\(\times\), 3\(\times\)), three scales are enlarged and the calculation will be fourteen times larger. Sliding the window on multiple scales to search for the position of the object in an exhaustive manner results in a huge number of candidate regions. Many scholars realized effective improvements in this respect. [PERSON] et al. [8] proposed an algorithm named SNIPER that performed efficient multi-scale training in instance-level visual recognition tasks. Their algorithm benefitted from batch normalization during training without the need to synchronize batch normalization statistics across GPUs and processed up to five images per second when reasoning with a single GPU. [PERSON] et al. [9] proposed a multi-scale graph convolution network based on a spectral-graph wavelet framework to improve multi-scale representation learning. This network flexibly utilized continuously scaled multi-scale adjacent information to enhance the recognition ability of the learned multi-scale representation and provided stable feature extraction under the guarantee of the theoretical framework. [PERSON] et al. [10] combined the Birch algorithm with an added multi-scale prediction of three-scale detection to improve real-time performance and accuracy.