Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 10, No. 2, 2024 91 Anomaly Detection for Landslide Displacement Monitoring Data Based on TCN‐Transformer Hao Jiang, Lin Li Chengdu University of Technology, Chengdu, Sichuan, China Abstract: In view of the high false alarm rate of landslide early warning, this paper proposes a classification method of landslide displacement monitoring data based on TCN and attention mechanism to identify normal data and abnormal data. First, the original monitoring data is processed and denoised to improve the data quality. Then, TCN is used to capture the long-term dependence of time series data and highlight key features in combination with attention mechanism. Finally, the landslide displacement monitoring data can be accurately classified by building a classification model to find out the abnormal data and reduce the false alarm rate of early warning. Experiments show that this method can recognize abnormal displacement monitoring data well while ensuring a high recall rate, and reduce the false alarm rate of early warning. Keywords: Time convolutional network; Attention mechanism; Landslide warning; Anomaly detection. 1. Introduction With the global climate change and the intensification of human activities, the frequency and scope of landslide disasters are on the rise, posing a serious threat to the safety of people's lives and property and the ecological environment. Landslide displacement monitoring is an important means of landslide disaster early warning and prevention. Through real-time monitoring and analysis of landslide displacement, we can timely grasp the dynamic changes of landslide and provide scientific basis for landslide disaster early warning[1]and emergency response. However, the traditional landslide displacement monitoring methods often rely on manual observation and empirical judgment, and there are problems such as low monitoring efficiency, poor data accuracy [2]and poor real- time performance. Therefore, the research and development of new landslide displacement monitoring methods have important practical significance and application value. In recent years, with the rapid development of artificial intelligence and deep learning technology, time series analysis method has been widely used in the classification and prediction of landslide displacement monitoring data. Among them, time convolution network (TCN), as a deep learning method specially used to process time series data[3], has strong temporal feature extraction and classification capabilities. However, traditional TCN still has some limitations[4] when dealing with complex time series data.In order to improve the performance of TCN in the classification and early warning of landslide displacement monitoring data, this study introduces the TCN Attention model[5] based on attention mechanism. TCN Attention model combines the advantages of convolutional neural network (CNN) and attention mechanism, enhances the extraction of key time features and importance weighting through attention mechanism, thus improving the classification and prediction ability of the model for landslide displacement data. The purpose of this study is to explore the method of classification and early warning of landslide displacement monitoring data using TCN Attention model, and to verify its effectiveness and feasibility through experiments. By introducing deep learning technology and attention mechanism, the processing efficiency and classification accuracy of landslide displacement monitoring data can be improved, providing a more scientific and effective means for landslide disaster early warning and prevention. 2. Relevant Theoretical Work 2.1. Landslide monitoring technology The development of landslide monitoring technology can be traced back to early manual inspection and simple physical sensor application. At this stage, landslide monitoring relies on manual observation and ground survey, which is not only inefficient, but also limited by the experience of observers and geographical conditions, so it is difficult to achieve comprehensive and continuous monitoring. Subsequently, with the rapid development of sensor technology, landslide monitoring systems based on geological radar, GPS, inclinometer and other physical sensors gradually emerge[6]. These advanced monitoring systems can obtain real-time landslide displacement data, providing important support for landslide early warning and emergency response. However, although these systems have made significant breakthroughs in technology, they still face many challenges in practical applications. High equipment cost, complex installation and maintenance process and sensitivity to environmental conditions limit its wide application. However, the landslide monitoring data may be affected by many factors, such as equipment error, environmental interference, etc., resulting in missing or inaccurate data, which ultimately leads to a high false alarm rate of the actual landslide early warning work. 2.2. Data anomaly detection method After years of development, data anomaly detection technology has gradually evolved from early statistical based methods to complex models based on machine learning[7] and deep learning. Early anomaly detection methods mainly rely on simple statistical models, such as methods based on standard deviation and mean, which are inefficient in dealing with large-scale data sets and insensitive to complex data distribution. With the rise of machine learning technology, clustering analysis, classification algorithms, association 92 rules and other technologies have been introduced into the anomaly detection field. These methods can better handle nonlinear relationships and complex patterns[8], and improve the accuracy of anomaly detection. In recent years, the rapid development of deep learning technology has brought a new breakthrough for data anomaly detection. Anomaly detection methods based on deep learning models such as self encoders, generated countermeasures networks and variational self encoders show excellent performance in processing high- dimensional data and complex patterns[9]. These models can learn the internal feature representation of data from a large number of normal data, thus effectively identifying outliers. As the landslide displacement monitoring data is time series data, this paper considers the use of deep learning algorithm to process time series tasks for anomaly detection[10], and considering the real-time requirements of landslide monitoring and early warning work, it decides to use time convolution network to identify abnormal data. 2.3. Application of TCN and Attention Mechanism Time convolution network (TCN) is a neural network architecture designed specifically for serial data. It can effectively process long series data and capture long-term dependencies in time series. TCN has achieved remarkable success in natural language processing, speech recognition and time series prediction. For example, Google's WaveNet model uses TCN to generate natural speech waveforms. The attention mechanism allows the model to focus on the key information in the input data, thus improving the interpretation ability and performance of the model. For example, OpenAI's GPT series models use the attention mechanism to generate coherent text. In the abnormal detection task of landslide monitoring data, attention mechanism can fully learn the overall trend of data, thus improving the accuracy of abnormal monitoring and reducing the rate of early warning false alarm. 3. Construction of Anomaly Detection Algorithm 3.1. TCN Principle Time convolution network is a kind of deep learning model specially designed for processing time series data. It ensures that the output only depends on the current and past inputs through causal convolution, thus maintaining the causal relationship of time series. At the same time, it uses expansion convolution to expand the receptive field, so that the network can capture a longer time dependency without adding additional parameters, solving the problem of gradient disappearance or explosion encountered by traditional recurrent neural networks when processing long series. TCN also combines residual connection and batch normalization to improve the stability and efficiency of training. This structure makes it perform well in processing the classification, prediction and regression tasks of time series data, especially in the scenarios that need to process long series and real-time prediction. TCN is widely used. TCN has an extended causal convolution structure, which can expand the sampling of the input data of the upper layer and extract the characteristics of various time series data. Causal convolution can ensure the causality of extracted feature information. For TCN with convolution core of 2 and expansion coefficients of 1, 2, and 4, the expansion causal convolution structure is shown in Figure 1. Figure 1. TCN expansion causal structure (1) Causal Convolution: This convolution ensures that the output of the model only depends on current and past inputs, and will not reveal future information. (2) Causal Convolution: Expansion convolution allows the network to expand its receptive field while maintaining the same number of parameters. By using different expansion rates in different layers, it can effectively capture long-term time dependence. (3) Residual Connections: Residual connection helps to solve the problem of gradient disappearance in the deep network, making the network deeper, while maintaining the stability of training. The network can learn residual mapping by adding the input directly to the following layer through jump connection. (4) Batch Normalization: Batch normalization helps stabilize the training process, reduce internal covariate deviation, accelerate convergence, and improve the generalization ability of the model. It makes the distribution of input at each level more stable by normalizing each small batch of data. Figure 2. TCN residual unit 3.2. Transformer Transformer is a deep learning model based on self attention mechanism, which was proposed by Vaswani et al. in 2017 and is mainly used in the field of natural language 93 processing. Through the self attention mechanism, this model allows all other inputs in the sequence to be considered while processing each input, and gives different weights according to their relationships. In order to further enhance the expression ability of the model, Transformer adopts a multi head attention mechanism, which applies the self attention mechanism in parallel for many times, paying attention to different information each time, and then stitching these results together and processing them through a linear layer. In addition, position coding is introduced to represent the position information of words in the input sequence, so that the model can capture the sequence information of the sequence. Transformer model also includes feedforward neural network, which provides nonlinear capability for the model. Each self attention and feedforward network layer is followed by residual connection and layer normalization, which is helpful to the training stability and performance of the model. In general, Transformer model has become one of the mainstream models in the field of natural language processing due to its efficient self attention mechanism and parallel computing ability, and has also been applied in other fields such as computer vision and audio processing. Figure 3. Transformer structure 3.3. Construction of anomaly detection algorithm The anomaly detection algorithm based on TCN Transformer is a technology combining time convolution network (TCN) and Transformer model, which is specially used to identify abnormal points in landslide displacement monitoring data. The algorithm first uses TCN to model time series data and capture long-term dependencies, and then further extracts data features through Transformer model. Finally, anomaly recognition is carried out by combining the self attention mechanism and the feature information extracted by TCN. The algorithm can effectively identify abnormal points and provide accurate data support for landslide early warning. This method has significant advantages in processing large-scale and high-dimensional landslide displacement monitoring data, and can improve the accuracy and efficiency of anomaly detection. The model diagram of this algorithm is shown in Figure 4. Figure 4. TCN Transformer Model Diagram 4. Experimental Analysis 4.1. Experimental environment The running environment of machine learning model in this paper is shown in the table below: Table 1. Experimental environment name Specifications operating system Windows11 Memory capacity 16GB CPU AMD Ryzen 7 5800H GRU RTX3060 Python 3.8.15 4.2. Evaluating indicator Model evaluation indicators play a crucial role in deep learning tasks. They can help researchers better identify and evaluate the effects of different tasks, such as measuring the experimental effects of classification, regression, sorting, clustering and other tasks with model evaluation indicators, so as to help the experimenter better achieve the task objectives. Therefore, it is very important to select appropriate model evaluation indicators. For the effect of anomaly detection tasks, the accuracy rate, recall rate, accuracy rate, F1 value and other evaluation indicators are used to measure the performance of each in-depth learning model. Considering the importance of the landslide field, the recall rate is taken as the most important indicator. (1) Accuracy The accuracy of the model is one of the most basic evaluation indicators in the classification problem. It represents the ratio between the number of samples correctly predicted by the model and the total number of samples. The calculation formula of accuracy rate is as follows:     Count correct Acc Count total  In the formula, Count (correct) is the number of correctly predicted samples, and Count (total) is the number of all samples.In case of abnormal detection, the formula for calculating the accuracy rate is as follows: TP TN Acc TP FP FN TN      Accuracy is an intuitive and easy to understand important indicator, which reflects the number of samples that the model can accurately predict in the classification process. However, when the class distribution of the dataset is uneven, the model only needs to predict most class samples to achieve high accuracy. Therefore, in the case of unbalanced sample categories, it is misleading to rely solely on the accuracy rate to evaluate the model. And the accuracy rate only provides an overall indicator, and it is impossible to know the 94 classification performance of each model in each category. (2) Precision The accuracy rate measures the proportion of all samples predicted by the model to be positive, and the calculation formula is as follows. Pr TP TN ecision TP FP FN TN      (3) Recall In this study, recall refers to the probability that samples labeled as normal data are actually recognized as normal data. The calculation formula is shown in the following formula. Re TP call TP FN   By evaluating the recall rate, this paper can accurately understand how many normal data are successfully predicted. In the field of landslide disasters, normal data cannot be generally identified as abnormal data, so this paper will try to improve the recall rate index in the experiment. (4) F1 F1 is the comprehensive value of Precision and Recall, which avoids the problems that may be caused by focusing only on one of the indicators. The maximum value of F1 is 1, and the minimum value is 0. The higher the F1 value, the better the performance of the model in terms of accuracy and recall. The specific formula for calculating the F1 value is shown in the following formula. 2 1 2 TP F TP FN FP      4.3. Experimental result TCN Transformer model is used to test on GNSS and fracture data sets respectively. The actual anomaly detection effect is shown in Table 2. It can be clearly seen that the model has a strong ability to identify the abnormal data in the landslide displacement monitoring data, and can maintain 90% accuracy while ensuring a high recall rate. Table 2. Identification effect of abnormal data data type Accuracy Precision Recall F1 GNSS data 89.08% 81.18% 97.08% 0.8824 Fracture data 88.72% 77.84% 96.21% 0.8585 5. Conclusion This paper discusses the application of TCN Attention model based on TCN and Attention in the classification and early warning of landslide displacement monitoring data. Through the construction and experimental verification of the model, the following conclusions are drawn: TCN Attention model shows significant application value in the classification and early warning of landslide displacement monitoring data. By combining TCN and Attention mechanism, the model can effectively extract key features in time series data, and strengthen the attention to important time points. The experimental results show that the TCN Attention model has high accuracy and real-time performance in the abnormal identification task of landslide displacement monitoring data, which provides strong support for the early warning and prevention of landslide disasters. Although the TCN Attention model has achieved good results in the current research, there is still room for further research. Future research directions can be carried out from the following two aspects: First, further optimization of the model. The performance of the model in landslide displacement monitoring data classification and early warning can be further improved by adjusting the structure and parameters of the model, such as increasing the depth of the alluvium, expanding the receptive field, etc. In addition, other advanced technologies, such as transfer learning and reinforcement learning, can be explored to enhance the generalization ability and adaptability of the model. The second is the application of the model in a wider range of scenarios. The application of TCN Attention model in the classification and early warning of landslide displacement monitoring data is only the starting point, and it can be applied to a wider range of scenarios in the future, such as other geological disaster early warning, environmental monitoring, financial risk control and other fields. By expanding the application scope of the model, the practicability and universality of TCN Attention model can be further verified and improved. In a word, this study is based on the application of TCN Attention model in the classification and early warning of landslide displacement monitoring data, which verifies the effectiveness and feasibility of the model. Future research will continue to focus on the optimization and expansion of the model, with a view to providing more scientific and effective solutions for landslide disaster early warning and wider applications. References [1] Wen-gengCao, YuFu, Qiu-yaoDong, et al. Landslide susceptibility assessment in Western Henan Province based on a comparison of conventional and ensemble machine learning [J]. China Geology , 2023,6(3): 409-419. [2] A.L.Achu, C.D.Aju, MarianoDiNapoli, et al. Machine-learning based landslide susceptibility modelling with emphasis on uncertainty analysis [J]. Geoscience Frontiers, 2023,14(6): 339-352. [3] ShanRongrong, MaZhenyu, LuHongyu. A voltage control method for distribution networks based on TCN and MPGA under cloud edge collaborative architecture[J]. Measurement: Sensors, 2024,31: 100969-. [4] HuXiaoke, ZhouXiaomin, LiuHongfei, et al. Enhanced predictive modeling of hot rolling work roll wear using TCN- LSTM-Attention[J]. The International Journal of Advanced Manufacturing Technology, 2024,131(3-4): 1335-1346. [5] XiaodanWang, PengWang, YafeiSong, et al. Recognition of high-resolution range profile sequence based on TCN with sequence length-adaptive algorithm and elastic net regularization[J]. Expert Systems With Applications, 2024,248: 123417-. [6] JialongYu, ChuntaoYang, JiangtaoTan. Research and Development Trend of Landslide Deformation Monitoring Methods[J]. Advances in Computer, Signals and Systems, 2023,7(3). [7] WangChun, PanShirui, YuCelinaP., et al. Deep neighbor- aware embedding for node clustering in attributed graphs[J]. Pattern Recognition, 2022,122. [8] HeiglMichael, AnandKumarAshutosh, UrmannAndreas, et al. On the Improvement of the Isolation Forest Algorithm for Outlier Detection with Streaming Data[J]. Electronics, 2021,10(13): 1534-1534. 95 [9] XiaowuDeng, PengJiang, XiaoningPeng, et al. Support high- order tensor data description for outlier detection in high- dimensional big sensor data[J]. Future Generation Computer Systems, 2018,81: 177-187. [10] GuptaShalmoli, KumarRavi, LuKefu, et al. Local search methods for k-means with outliers[J]. Proceedings of the VLDB Endowment, 2017,10(7): 757-768.