# Deep Learning for Anomaly Detection in CNC Machine Vibration Data: A RoughLSTM-Based Approach
## 1 Introduction
The deep metric learning (DM) method based on Mahalanobis distance was developed to calculate feature distances, achieving a performance increase of up to 1.8% compared to existing methods. [PERSON] et al. [14] propose a self-supervised multi-transformation learning model for anomaly detection in time series data. The model detects anomalous data by using the reconstruction errors of two transformations as anomaly scores. In a study by [PERSON] et al. [15], where a model based on contrastive learning is proposed for anomaly detection in electrical load data, the model is trained with a contrastive loss function by separating the input into positive and negative pairs. The model increases scalability and cost-effectiveness by reducing the need for large labeled data. [PERSON] et al. [16] propose a novel contrastive-learning-based framework, ACAD (adaptive contrastive learning for smart contract attack detection) for anomaly detection in smart contracts. Conducted experiments show that ACAD outperforms existing methods. [PERSON] and [PERSON] [17] propose a novel one-class anomaly detection algorithm that combines contrastive learning and transfer learning methods to perform reliable anomaly detection with limited sensor data in industrial processes. The proposed model consists of three main components: anomaly detection, transfer learning, and contrastive learning. In another study [18], a new model called multi-granular contrastive learning (MulGad) is proposed for anomaly detection in multivariate time series. The proposed model combines contextual contrastive learning and cross-series contrastive learning to capture both fine- and coarse-grained discriminative information. [PERSON] and [PERSON] [19] propose the variable temporal transformer (VTT) model for anomaly detection in multivariate time series data. The model has been tested on real-world datasets such as SWaT, SMD, MSL, and SMAP and has been proven to outperform traditional methods. The GDTS model proposed in another study [20] sets a new standard in anomaly detection by combining graph diffusion and transformer-based time series modeling. In a study by [PERSON] and [PERSON] [21], a new approach is presented to provide more reliable data analysis in ocean sciences and climate research. A transformer- and fast Fourier transform (FFT)-based model is proposed for anomaly detection in an Argo dataset. As a result of the experiments, it has been seen that the developed model exhibits successful performance in terms of F1-score, sensitivity, and accuracy. Deep learning plays a significant role in the design of methods for detecting abnormal behavior in machines and facilitates the development of new diagnostic techniques by monitoring vibration signals. Algorithms in this field aim to model with high-level data abstraction through architectures where both linear and nonlinear operations are sequential. Deep learning primarily deals with classification (discrete outputs) and regression (continuous outputs) problems to answer questions on large datasets [22]. Due to its ability to process data and automatically recognize features at multiple levels of abstraction, deep learning has become a highly popular method for extracting information (features) from data [23]. In industrial contexts, tasks such as (i) reducing the number of failures, (ii) increasing the reliability of production tools, (iii) improving availability rates, and (iv) optimizing spare parts stock management are of great importance. Regularly collected vibration data from rotating machines allow the detection or prediction of possible faults through vibration analysis [24]. Fault detection is typically done using image processing techniques, which take advantage of various detection and analysis methods to automate specific tasks. Image processing technology can classify objects or detect abnormalities or production defects in an image. Segmentation can be defined as a detection task based on placing an element at the nearest pixel in an image.