Introduction. The problem of determining the train coordinates on the approach section to the crossing is associated with the impact of destabilizing factors on the information primary detector ? the rail line with distributed parameters. This leads to an error in calculating train coordinates. The aim of the study is to develop and scientifically substantiate the principle of building a system for calculating train coordinates with self-tuning of the decision function under the influence of significant destabilizing factors on the information primary sensor. Materials and Methods. To solve the problem of reliable determination of train coordinates, we propose a two-phase principle for forming the decision function. At the first stage, by means of a training sample of images and using the learning principle, the decision function (model) of the system for calculating train coordinates is determined. When the train enters a fixed-length approach section, the mismatch is determined by comparing the calculated coordinate with the fixed one. The second stage is the self-tuning of the coefficients of the decision function until the required accuracy is achieved. Results. The article shows the stages of forming the decision function by two-dimensional images; there was developed and tested an algorithm for self-turning of the decision function under the influence of various destabilizing factors. Through using 6 attributes of components of current and voltage vectors at the rail line input, 6 solving functions were obtained. Various combinations of two-dimensional images were used as polynomial arguments. Discussion and Conclusion. The study results confirm the feasibility of forming decision function and its self-tuning. The maximum error in calculating coordinates for various combinations ranges from 9.97% (199.34 m) to 4.57% (91.49 m). The error of determination of 5% for two decisive functions satisfies the safety requirements, since in a 45-second time interval to activate an automatic crossing signal, a distance of 100 m is covered in 3 seconds, i.e. the elapsed time is only 3 seconds in a 45 second interval.