## 3 Algorithms
### Algorithm for Offline Basic Model Construction  
The algorithm designed to construct the basic model in this study comprises two parts: training and analysis of an RBF-DNN to obtain the key features needed to construct the basic model and the means of utilizing these key features to construct the basic model. Note that the content of the first part is more complex, so we further divide our introduction of the first part into three portions: (1) the design concept of the RBF-DNN, (2) the network framework of the RBF-DNN, and (3) the means of analyzing the trained RBF-DNN parameters to obtain the key features. The RBF-DNN is constructed with a neuron that has an RBF as the activation function added before the DNN. This method has been proven by researchers to be useful in finding the most important input features for modeling. Studies on radial basis function neural networks [16; 17] and fuzzy neural networks [54; 55], for example, have discussed this issue. For deep learning models, the feasibility of this theory has also been successfully proven on  
Figure 4: The framework of the product fault detection system developed in this study. LSTM [15] and RNNs [4]. We therefore extended this concept and added an RBF neuron to an existing model to identify important input features for product fault detection models. We adopted a DNN for our deep learning model rather than the previously discussed LSTM [15] and RNNs [4] because product fault detection models usually process the machine data that they collect from different products separately. In this case, machine data with a sequential format are segmented into independent items of data for processing, LSTM and RNNs, which are dedicated to sequential data, are therefore unsuitable for the target problem. Below, we introduce the proposed RBF-DNN for feature extraction. The framework of the proposed RBF-DNN is shown in Figure 5, comprising an input layer, an RBF layer, multiple fully connected layers, and an output layer. First, the input layer brings the input features of the model into the neural network. Assuming that the product fault detection system extracts a total of \(n\) features from the machine data, expressed as \(\langle\psi_{1},\psi_{2},\dots,\psi_{n}\rangle\), then the input layer will have \(n\) neurons, each responsible for accepting the values of one feature. Next, in the RBF layer, each input layer output will have \(q\) neurons responsible for converting it into \(q\) probability values. As shown in Figure 6, for example, the RBF centers of three neurons are located at low, middle, and high values. If an input layer value is 0.8, it will be converted into three probabilities, (0, 0.2, 0.7), as shown in Figure 6a. If another input layer value is 0.1, it will be converted into three probabilities, (0.7, 0, 0), as shown in Figure 6b. As for the RBF conversion formula in this paper, we adopted the most common approach, set as  
\[O_{ij}=exp[-(O_{inputi}-m_{ij})^{2}/\sigma_{ij}^{2}], \tag{1}\]  
where \(O_{ij}\) denotes the output of RBF neuron \(j\) (\(j\leq q\)) of input layer neuron \(i\) in the RBF layer; \(O_{inputi}\) represents the output of input layer neuron \(i\); and \(m_{ij}\) and \(\sigma_{ij}\) are the mean and standard deviation of this RBF neuron, respectively. After the RBF layer converts the input feature values into probabilities, we next use multiple fully connected layers to establish the nonlinear relationships between these probabilities and the output results. The format of the RBF-DNN output is consistent with that of the product fault detection (i.e., good/bad product or Type 1/Type 2 bad product).