## 4 Metro Track Geometry Defect Identification Model and Its Optimization Method
### MTGDI-CNN Based on DARTS
#### 4.2.4 Cell Architecture Search Based on DARTS  
Because of the aforementioned design, the cell has the ability to extract vibration features efficiently, but the connection mode of the feature maps (cell architecture) needs to be optimized according to the characteristics of the CVD-based metro-TGD identification problem. Cell architecture search (CAS) is a two-level optimization problem, as indicated in (1) and (2). In the problem, the cell needs several intermediate nodes and various computing operation kernel sizes to extract the vibration features of different-length TGD and analyze the relationship between the features. Therefore, the search space in (1) is still considerably large. However, the train-to-convergence process formulated in (2) requires considerable time. Therefore, the CAS persists as a difficult problem. DARTS [38] was introduced to address this problem. To effectively search in the CAS search space, DARTS changed the space from discrete to continuous and used the gradient-descent method to improve the search speed. To reduce the time assumption of inner optimization, DARTS replaces the training-to-convergence process with a second-order  
Figure 8: Architecture of (**A**) 2D DSCB; (**B**) 2D DiSCB. approximation of the optimal weights based only on the first-generation training results. In a cell, the feature map \(p^{(j)}\) of the intermediate node \(j\) is calculated using Equation (8). \[p^{(j)}=\sum_{i<j}o^{(i,j)}\Big{(}p^{(i)}\Big{)}, \tag{8}\]  
where \(o^{(i,j)}\) denotes the computing operation that connects nodes \(i\) and node \(j\). The traditional NAS search method involves searching for different combinations of \(o^{(i,j)}\) discretely. In contrast, DARTS converts the fixed operation \(o^{(i,j)}\) between nodes into a mixed operation \(\overline{o}^{(i,j)}\), which is defined by a softmax value of all kinds of operations combined with weights \(\alpha_{o}^{(i,j)}\), thereby changing the connection between nodes from discrete type selection to continuous weight change and realizing the transformation of discrete search space to the continuous variant, as demonstrated in Equation (9). \[\overline{o}^{(i,j)}(p)=\sum_{o\in\mathcal{O}}\frac{\exp\Big{(}\alpha_{o}^{(i, j)}\Big{)}}{\sum_{o^{\prime}\in\mathcal{O}}\exp\Big{(}\alpha_{o^{\prime}}^{(i,j)}\Big{)}}o(p), \tag{9}\]  
where \(\overline{o}^{(i,j)}\) denotes the mixed operations between node pairs \((i,j)\), \(\mathcal{O}\) denotes the set of all alternative operations, and \(\alpha^{(i,j)}\) denotes the weight vector of the elements in \(\mathcal{O}\). When the search is completed, the operation with the largest weight is utilized to replace the mixed operation, that is, the discrete cell architecture is restored, as expressed in Equation (10). \[o^{(i,j)}=\underset{o\in\mathcal{O}}{\text{argmax}}\alpha_{o^{\prime}}^{(i,j)} \tag{10}\]  
Let \(\alpha\) denote all architecture parameters in model architecture \(\mathbf{A}\). The two-layer optimization model of Equations (1) and (2) can be expressed as Equations (11) and (12), respectively. \[\underset{\alpha}{\text{min}}L_{\text{vali}}(w_{\alpha},\alpha), \tag{11}\]  
\[\text{s.t.}w_{\alpha}=\underset{w}{\text{min}}L_{\text{train}}(\mathbf{w},\mathbf{ \alpha}), \tag{12}\]  
where \(L_{\text{vali}}\) denotes \(L(\cdot,\mathbf{D}_{\text{vali}})\), and \(L_{\text{train}}\) represents \(L(\cdot,\mathbf{D}_{\text{train}})\). Because (10) transforms the search space of the cell architecture into a continuous space, the gradient method can be employed for \(\alpha\)-optimization in Equation (12), that is, along the gradient \(\
abla_{\alpha}L_{\text{vali}}(w_{\alpha},\alpha)\) to determine the minimum value iteratively. However, considerable time is required to train \(w_{\alpha}\) to converge; thus, DARTS only conducts one-generation training, utilizes its result to estimate the gradient to update \(w\), and assumes the updated \(w\) as the approximate value of \(w_{\alpha}\), as represented in Equation (13).