## 2 Architecture of the CAPT Framework
### Training Method of Layer 2  
The second layer of the detector is trained by using soft-margin SVMs [47]. SVM is a type of binary classifier that has been widely used [10; 47; 48; 49] in speech processing. Classical SVMs build the classifier by searching for some hyperplane \((\mathbf{W}^{(2)},b)\) that maximizes the margin between the two target clusters (correct pronunciations or not). This method classifies the utterance samples with a \"hard margin\" determined by support vectors, which may result in an over-fitting problem. For this issue, based on the SVM model of this paper (see (3)), we propose to use soft-margin SVMs to build the classifier by searching for some hyperplane \((\mathbf{W}^{(2)},b)\) that maximizes the soft margin between the two target clusters:  
\[\min_{\mathbf{W}^{(2)},b}\frac{1}{2}||\mathbf{W}^{(2)}||^{2}+C\sum_{j=1}^{N}J_{c}(h^{( 2)}(\mathbf{x}_{i}^{(2)})-y_{i}^{(2)}) \tag{6}\]where \(\mathbf{x}_{i}^{(2)}\) is the \(i\)-th predictor vector used to train the second layer, and \(C\) is the regularization constant. \(J_{\varepsilon}\) is the insensitive loss function:  
\[J_{\varepsilon}(\mathbf{z})=\left\{\begin{array}{ll}0&\text{ if }|\mathbf{z}|\leq \varepsilon\\ |\mathbf{z}|-\varepsilon&\text{ otherwise}\end{array}\right. \tag{7}\]  
where \(\varepsilon\) is the maximum error between the prediction results and the corresponding labels. The problem above can be solved by using the lagrange multiplier method. We introduce two slack variables \(\xi_{i}\) and \(\xi_{i}^{\prime}\) that correspond to the dissatisfaction degree with the margin constraint, so that  
\[\begin{split}&\min_{\mathbf{W}^{(2)},b_{i}\xi_{i}^{\prime}}\frac{1}{2 }||\mathbf{W}^{(2)}||^{2}+C\sum_{i=1}^{N}(\xi_{i}+\xi_{i}^{\prime})\\ \text{s.t.}&h^{(2)}(\mathbf{x}_{i}^{(2)})-y_{i}^{(2)}\leq \varepsilon+\xi_{i}\\ &y_{i}^{(2)}-h^{(2)}(\mathbf{x}_{i}^{(2)})\leq\varepsilon+\xi_{i}^{ \prime}\\ &\xi_{i}\geq 0\\ &\xi_{i}^{\prime}\geq 0\end{split} \tag{8}\]  
with  
\[i=1,2,\ldots,N\]  
The lagrange function of (6) \(\mathfrak{L}\) therefor can be written as  
\[\begin{split}\mathfrak{L}(\mathbf{W}^{(2)},b,\mathbf{a},\mathbf{a}^{\prime}, \mathbf{\xi},\mathbf{\xi}^{\prime},\mathbf{\mu},\mathbf{\mu}^{\prime})&=\frac{ 1}{2}||\mathbf{W}^{(2)}||^{2}+C\sum_{i=1}^{N}(\xi_{i}+\xi_{i}^{\prime})-\sum_{i=1} ^{N}\mu_{i}\xi_{i}-\sum_{i=1}^{N}\mu_{i}^{\prime}\xi_{i}^{\prime}\\ &+\sum_{i=1}^{N}\alpha_{i}(h^{(2)}(\mathbf{x}_{i}^{(2)})-y_{i}^{(2)}- \varepsilon-\xi_{i})\\ &+\sum_{i=1}^{N}\alpha_{i}^{\prime}(y_{i}^{(2)}-h^{(2)}(\mathbf{x}_{ i}^{(2)})-\varepsilon-\xi_{i}^{\prime})\end{split} \tag{9}\]  
where \(\xi_{i}\) and \(\xi_{i}^{\prime}\) are the slack variables. \(\mu_{i}\geq 0\), \(\mu_{i}^{\prime}\geq 0\), \(\alpha_{i}\geq 0\) and \(\alpha_{i}^{\prime}\geq 0\), which correspond to the columns of \(\mathbf{\mu},\mathbf{\mu}^{\prime},\mathbf{\alpha}\) and \(\mathbf{\alpha}^{\prime}\), are the lagrange multipliers and can be solved by building the dual problem of (8) with the Karush-Kuhn-Tucher constraints [27]. The desired coefficient matrix \(\mathbf{W}^{(2)}\) of the second layer are obtained by computing the partial derivatives of (9) with respects to \(\mathbf{W}^{(2)}\), \(b\), \(\xi_{i}\) and \(\xi_{i}^{\prime}\). The final bias \(b\) is  
\[b=\frac{1}{N}\sum_{i=1}^{N}b_{i} \tag{10}\]  
with  
\[b_{i}=\left\{\begin{array}{ll}y_{i}^{(2)}+\varepsilon-\sum_{j}^{N}(\alpha_{ j}^{\prime}-\alpha_{j})\mathbf{x}_{i}^{(2)}\mathbf{x}_{j}^{(2)}{}^{T}&\text{ if }0<\alpha_{i}<C\\ 0&\text{ otherwise}\end{array}\right. \tag{11}\]  
where \(b_{i}\) is the bias value corresponding to \((\mathbf{x}_{i}^{(2)},y_{i}^{(2)})\).