## 5 Results and Discussion  
The obtained results of implementation of the YOLO algorithm based on CNNs were applied to images, videos, and real-time camera. Bounding box is an indicator of the detected object--green light signal. Above the bounding box is the class name and the reliability of class prediction in %. The algorithm is trained with input data that contain images of different distances from the target object. Figure 12 shows a test image. The system recognized and positioned the railway signal in test image. There is a special set of images with which the system is not trained, and these images are used to test the reliability of detection. The reliability of the selected image in Figure 12 is as high as 99.67%. Figure 11: Labeled images—Rectangle method. (**a**) Signal relatively far from the camera; (**b**) signal relatively close to the camera. Figure 12: Signal detection—bounding box, class, and system reliability (dataset 150). Figure 13 shows the same image, this time tested through a neural network trained with 500 input images. As can be seen in the figure, the reliability is even higher than in the previous figure--99.71%. A comparison was made between the detection reliability of the three neural networks, and the results are shown in Table 1.  
Better detection results were expected with a dataset of 500 images compared to a dataset of 150 images. That is in the largest percentage and it turned out to be an accurate statement. There are a number of images where a set of 150 images cannot detect the signal at all, even if it does exist in the image. However, a network trained in a set of 500 images finds such objects with a reliability of over 80%. In the highest percentage, the reliability between the two datasets differs by 10-20%. There have been several cases where the network trained with a set of 150 images gave better results. That phenomenon has been explained by the fact that the larger dataset is trained mostly with images from greater distances, where it gives excellent results. Such exceptions occurred with a few tested images from smaller distances. As expected, the network trained with a set of 1000 images gave the highest reliability. Figure 14 shows a graph of mean reliability for all three trained networks, tested on the sample from Table 1.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Test Image** & **CNNs (Dataset 150)** & **CNNs (Dataset 500)** & **CNNs (Dataset 1000)** \\ \hline
11,700 & No detection & 83.2\% & 85.3\% \\
20,950 & 81.98\% & 89.75\% & 92.75\% \\
21,650 & 99.67\% & 99.71\% & 99.71\% \\
25  
The visual results of the proposed method presented in Chapter 2 of this paper can be seen in Figure 15. It is a combination of a rail track detection system, implemented by traditional CV, and a signal detection, implemented with the help of CNNs. These two systems are connected in a common system for detection of rail track and signals on the railway, which, in addition to detecting the mentioned railway objects, provides high reliability by the fact that if the detected signal is not located next to the detected rails, it will be considered as not relevant and will not be presented as detected on the screen. The point of the interconnection between the rails and the signal is that the signal must come from the right side in relation to the predefined point on the rail and have its end limit on the imaginary y axis. Furthermore, existence of track on the right side is also checked as the signal must be placed before the right track (if it exists). This excludes from the whole range the possibility of detecting a signal that is not in the direction of the train's movement. The horizon must be taken into account, and the reference point on the rail must be adequately determined, so that there is no error in detection. However, this part of the algorithm is adaptable, which is an additional feature that provides high reliability. The main direction of further research is the creation of a holistic system for the detection of railway objects.