The purpose of train detection systems is to check that related track section is clear of vehicles before a train may be authorized to pass through a railroad. The detection of the train is important task for ensuring the safety of train traffic. Multi-layer Perceptron classifier, which consists of feedforward neural networks constructed of multiple layers of interconnected artificial neurons, proved to be effective for trainset class classification in this study. Using Raspberry Pi and IMU sensor BNO055, dynamic response of any train type interaction can be handled by windowing and Real Fast Fourier Transform (RFFT). Dense layer with 5 neurons, using the ReLu activation function, and specifying the input shape as (6= 3-axis accelerometer in X, Y, and Z directions, and 3 axis directions from gyroscope). The classification process in this implementation, which consist of three classes of train types, has been completed with accuracy above 92,7%.