# Multi-Scale Convolutional Recurrent Neural Network for
## 4 Experiment and Result Analysis
### Evaluation Metrics  
The receiver-operating characteristic curve (ROC curve), Matthews correlation coefficient (MCC), accuracy, and F1-score were calculated to evaluate the performance of the classifier for bearing defects in noisy situations.  
The Matthews correlation coefficient (MCC) is used in machine learning as a measure of the quality of binary and multiclass classifications. It takes into account true and false positives and negatives and it is generally regarded as a balanced measure, which can be used even if the classes are of very different sizes. The Matthews correlation coefficient equation is:  
\[\text{MCC}=\frac{|\text{TP}|*|\text{TN}|-|\text{FP}|*|\text{FN}|}{\sqrt{(|\text {TP}|+|\text{FP}|)(|\text{TP}|+|\text{FN}|)(|\text{TN}|+|\text{FP}|)(|\text{ TN}|+|\text{FN}|)}} \tag{8}\]  
The ROC curve is a widely used method of determining the effectiveness of a diagnostic method, and it represents the relationship between sensitivity and specificity on a two-dimensional plane. The larger the area under the ROC curve, the better the model. Sensitivity and specificity can be expressed by the following equation.  
Specificity is the rate at which the model recognizes false as false. The equation is as follows:  
\[\text{Specificity}=\frac{|\text{TN}|}{|\text{TN}|+|\text{FP}|} \tag{9}\]  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Layer Name** & **Output Size** & **Network** & **Connected to** \\ \hline
3 Conv\_Layer1 & (20 \(\times\) 20) & Conv2D, kernel size = 5 \(\times\) 5 & Input\_Layer \\
1 Pool\_Layer3 & (2 \(\times\) 2) & Maxpooling2D, size = 2 \(\times\) 2 & 1C\_L3 \\
2 Pool\_Layer2 & (2 \(\times\) 2) & Maxpooling2D, size = 2 \(\times\) 2 & 2C\_L3 \\
3 Pool\_Layer1 & (2 \(\times\) 2) & Maxpooling2D, size = 8 \(\times\) 8 & 3C\_L1 \\ Merge\_Layer & (2 \(\times\) 2) & Concatenate & 1P\_L3, 2P\_L2, 3P\_L1 \\ LSTM\_Layer & 64 & LSTM & M\_L \\ Flatten\_Layer & 120 & - & LSTM\_L \\ FC\_Layer1 & 64 & Fully connected layer & Flatten\_L \\ FC\_Layer2 & 32 & Fully connected layer & FC\_L1 \\ Output Layer & 10 & Softmax & FC\_L2 \\ \hline \hline \end{tabular}
\end{table}
Table 2: _Cont._  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Hardware Environment** & **Software Environment** \\ \hline CPU: Intel Core i7-8700K, 3.7 GHz, \\ six-core twelve threads, 16 GB & Windows TensorFlow 2.0 framework \\ GPU: George GTX 1080 Ti & Python 3.7 \\ \hline \hline \end{tabular}
\end{table}
Table 3: System specifications.  
Recall is the proportion of the true class to what the model predicts as true. The parameters, recall and precision, have a trade-off. Recall, also called sensitivity, can be expressed as follows:  
\[\text{Recal}(\text{Sensitivity})=\frac{|\text{TP}|}{|\text{TP}|+|\text{FN}|} \tag{10}\]  
Precision is the ratio of the true class to what the model classifies as true. The equation is as follows:  
\[\text{Precision}=\frac{|\text{TP}|}{|\text{TP}|+|\text{FP}|} \tag{11}\]  
Accuracy is the most intuitive indicator. However, the problem is that unbalanced data labels can skew the performance. The equation for this parameter is the following:  
\[\text{Accuracy}=\frac{|\text{TP}|+|\text{TN}|}{|\text{TP}|+|\text{FP}|+| \text{FN}|+|\text{TN}|} \tag{12}\]  
The F1-score is called the harmonic mean, and if data labels are unbalanced, it can accurately assess the performance of the model. The equation is given as follows:  
\[\text{F1 score}=2\frac{\text{Precision}*\text{Recall}}{\text{Precision}+ \text{Recall}} \tag{13}\]