# Early Fault Detection and Operator-Based MIMO Fault-Tolerant Temperature Control of Microreactor
## 6 Fault Detection System
### Creation of Classification Models by Learning
\[X=[\mathbf{u_{d_{1}}}(t),\mathbf{u_{d_{3}}}(t),\mathbf{y_{1}}(t),\mathbf{y_{2}} (t),\ldots,\mathbf{y_{3}}(t-l),\text{CF}(\mathbf{y_{1}}(t)),\text{CF}(\mathbf{y_{3}}(t))]\] \[\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\optimization algorithm inspired by the evolutionary process of living organisms, in which a real-coded vector is an individual and the value of the objective function is the strength of the individual. Real-coded genetic algorithms are characterized by the fact that they do not explicitly use the gradient of the objective function. Therefore, optimization is possible even for functions for which the gradient of the objective function cannot be obtained, such as the classification performance evaluation in this study. Figure 10 shows the process of hyperparameter optimization using the real-coded genetic algorithm.  
The process of Figure 10 is described in detail as follows.  
1. Obtain input/output data in advance by experiment as training data.
2. Add the expected fault elements to some of the previously acquired input/output data to create test data in the event of the fault.
3. Obtain the hyperparameters to be tested using the real-coded genetic algorithm.
4. Construct a tentative classification model by training using the training data and the hyperparameters obtained.
5. Calculate the classification performance evaluation value from the classification model and test data.
6. The real-coded genetic algorithm determines the hyperparameters to try next.
7. Repeat the process from 3 to 6 for the product of the number of individuals and the number of generations to obtain the optimized hyperparameters.  
Let \(\mathbf{z}\) be the hyperparameter to be tried. The maximization problem for improving the classification performance of this study is shown in Equation (48). \(p_{pre}\) is the precision. It is the pattern ratio in which the correct answer is anomalous when it is determined to be anomalous. Similarly, \(P_{rec}\) is the recall. It is the proportion of patterns for which the discriminant model was able to discriminate an abnormality out of the patterns for which the correct answer was abnormality. Therefore, the penalty for false positives increases as the value of \(r\) is increased.  
\[\max_{\mathbf{z}}-\frac{1}{rp_{pre}+(1-r)p_{rec}}\] (48) s.t. \[0<r<1\]  
The above process improves the performance of the classification model by optimizing the hyperparameters of the One-Class SVM.