## 3 Methodology
### Semi-Supervised Machining Feature Recognition Framework
#### 3.1.1 Self-Supervised Learning Stage  
In this paper, a self-supervised learning method, similar to SimSiam [21], is proposed for machining feature recognition. SimSiam is a self-supervised learning framework that can learn meaningful visual representation without requiring a complex architecture design, momentum encoder, negative sample pairs, or large batch size. However, SimSiam is designed for 2D visual tasks (e.g., image classification, 2D object detection, 2D semantic segmentation), which cannot meet the requirement for 3D machining feature recognition. Therefore, the proposed method extends SimSiam to learn effective visual representation from a large number of unlabeled 3D machining feature data for transferring to downstream tasks. The architecture of the self-supervised learning method is shown in Figure 2.  
At first, two randomly transformed (augmented) models \(x_{1}\) and \(x_{2}\) from a 3D model \(x\) are accepted as the architecture input. Then, the two models are fed into a shared weight encoder \(f\) composed of a CNN backbone network (e.g., ResNet-50) and a three-layer MLP projector (Figure 3). The encoder, which is in charge of projecting input into a representation space, generates two corresponding embeddings \(z_{1}\) and \(z_{2}\) according to \(x_{1}\) and \(x_{2}\). In this process, the projector is a key component whose main function is to transform visual  
Figure 1: The pipeline of the proposed semi-supervised machining feature recognition framework. representation into the space where similarity loss is applied [44]. The above operations are defined as follows:  
\[ \begin{split} x_{1}&=\mathcal{T}(x),\\ x_{2}&=\mathcal{T}^{\prime}(x),\\ z_{1}&=f(x_{1}),\\ z_{2}&=f(x_{2}),\end{split}  \tag{1}\]  
where \(\mathcal{T}\) denotes random augmentation, and \(f\) is a shared weight encoder. After that, one of the embeddings is sent to a predictor \(h\) (Figure 4), which returns a transformed embedding \(p_{1}\). The predictor only works on one embedding at a time, and its function is to match the output of one encoder to the other [46]. In other words, the predictor learns to predict and compensate for the difference between the outputs of two encoders. The predictor is a simple two-layer MLP, which has a similar architecture to the projector. The last batch normalization (BN) layer is removed in contrast to the projector because the BN layer causes the training results to be unstable [21]. The predictor transformation is as follows:  
\[p_{1}=h(z_{1}). \tag{2}\]  
Figure 4: The architecture of the two-layer MLP predictor. Figure 3: The architecture of the three-layer MLP projector. Figure 2: The architecture of the self-supervised method. After the predictor, the cosine similarity criterion is used to measure the distance between the two embeddings \(p_{1}\) and \(z_{2}\), which is defined as follows:  
\[\text{criterion}(x_{1},x_{2})=\frac{x_{1}\cdot x_{2}}{\max(\|x_{1}\|_{2}\cdot\|x _{2}\|_{2},\epsilon)}, \tag{3}\]  
where \(\|\cdot\|_{2}\) is \(l_{2}-norm\) of a vector, and \(\epsilon\) is a small value to avoid division by zero, usually \(1\times 10^{-8}\). Correspondingly, we get \(z_{1}\) and \(p_{2}\) by switching the input order of \(x_{1}\) and \(x_{2}\) according to [46]. The above operations can be written as follows:  
\[ \begin{split} z_{1}&=f(x_{1}),\\ p_{2}&=h(f(x_{2})).\end{split}  \tag{4}\]  
Now, the similarity loss is defined as follows:  
\[l=-\frac{1}{2}(\text{criterion}(p_{1},z_{2})+\text{criterion}(z_{1},p_{2})), \tag{5}\]  
which is symmetric. For the symmetrized similarity loss, an intuitive explanation is to pull the two embeddings closer in a representation space by maximizing their cosine similarity (i.e., to minimize \(L\)). Finally, error back propagation and the optimizer are utilized to compute the gradient and update the learnable parameters of the encoder and predictor. At each training step, stochastic gradient descent with momentum (SGDM) is performed to minimize the similarity loss \(l\), which is summarized as:  
\[