Anomaly Detection in Scale Model Trains Using LSTM Neural Networks
摘要
This study presents an analysis for detecting anomalies in model trains using LSTM (Long Term Short Term Memory) neural networks. A database compiled in a laboratory at the Autonomous University of Querétaro was used, containing 6 blocks of 19 experimental runs, with a total of 114 tests, including accelerometer data, angular velocities, and motor current. Z-score normalization and automatic anomaly labeling were employed, using a threshold of 3.5 standard deviations from the baseline. The LSTM model used has two layers: one with 64 units and the other with 32. The model was trained with the Adam optimizer and stopped early using EarlyStopping. Data fragments from 100 samples were used to train the model to learn patterns, and class weights were adjusted to ensure that less frequent anomalies were not ignored. The model correctly identified most cases with an accuracy between 97.66% and 95.71%, detected almost all anomalies with a recovery rate between 98.00% and 96.00%, and achieved an overall F1 score between 0.90 and 0.77. The LSTM model was also compared with an Isolation Forest algorithm to assess their performance. Therefore, these results support the claim that the proposed neural network can be applied to the preventive monitoring of railway systems.