# Stamping Tool Conditions Diagnosis: A Deep Metric Learning Approach
## 1 Introduction  
The metal stamping process remains one of the most common processes in manufacturing and is still being used by major industries, including the automotive, aerospace, and consumer appliances industries [1]. Therefore, the stamping process must be monitored and diagnosed to ensure that every product meets the required quality standards. A crucial component requiring diagnosis is the tool die, the quality of which can greatly affect the outcome of a product. One of the challenges in diagnosing stamping tool conditions is that, traditionally, the tools need to be visually checked and the production processes thus need to be halted. Following the trend of Industry 4.0, automation in stamping processes has triggered the use of online intelligent condition monitoring systems, which are crucial for improving the productivity and availability of production systems. Today's advanced sensor technology pays attention to and incorporates numerous mechanical properties such as vibration, strain, and displacement to monitor the conditions of manufacturing processes [2], however acquiring the mechanical properties from the tool is only the beginning of diagnosing its condition. Nonetheless, these data need to be analyzed and processed before we able to diagnose tool condition. The advancement of Industry 4.0 also accelerates the research and development of machine learning, which is extremely helpful to analyze the non-linear data that are being used to monitor stamping process. Traditional signal processing and conventional machine learning methods have been employed in several studies on the stamping processes and tool diagnosis. For example,Ge [3] used the hidden Markov model, [PERSON] [4] used empirical mode decomposition combined with learning vector quantization, and other researchers [5; 6; 7; 8] have employed audio and autoencoders (AEs). Furthermore, [PERSON] [9] used support-vector machines, and [PERSON] [10] used a wavelet transform combined with semi-supervised clustering. [PERSON] [11] proposed a recurrence plot based on waveform signals to monitor the progressive stamping process. [PERSON] [12] used an embedded pressure sensor inside a tool die to monitor the stamping process. However, these studies had several shortcomings: (1) the manual feature extraction process can be tedious, requiring substantial time and effort; (2) manually extracted features do not adapt well to evolving conditions and scenarios during the stamping process. Deep learning methods that have been developed have been applied to intelligent condition diagnosis, achieving favorable results [13] using architectures such as convolutional neural networks (CNNs) [14; 15; 16; 17; 18], AEs [19; 20; 21; 22; 23], and recurrent neural networks [24; 25; 26; 27; 28]. CNNs, which employ neural nodes as a type of filter, enable deep learning structures to extract features from complex and highly nonlinear signals. In our previous work [29], a CNN was used to evaluate the condition of a stamping tool, achieving favorable results; however, several problems remain to be resolved. First, to add a new class, the model must be retrained, which requires a high computational cost. Second, to retrain the model, sufficient data for each class and the retraining process must first be obtained, which requires subsequent downtime. [PERSON] [30] proposed a network architecture called a Siamese network, that has two inputs and compares the similarity between these inputs; the deep metric learning (DML) [31] algorithm has same principle, but to produce that similarity, a DML uses deep learning to extract features to be compared, using this technique it provides several advantages over traditional deep learning methods. First, the feature extraction module (FEM) (i.e., CNN), with all its benefits, is still used to extract features. Second, rather than learning to discover a class, DML identifies similarities between two objects, thereby we can dynamically add a new, unseen class without the requirement for model retraining.