# Improving Deep Learning Anomaly Diagnostics with a Physics-Based Simulation Model
## 3 Physics-Based Simulation Modeling and Anomaly Detection
### Physics-Based Real Anomaly Detection  
The simulation model is tested with the other available data sets to observe deviations from the normal machine behavior. The presented input data set DS2 input contains  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Signal** & **N** & **Minimum** & **Maximum** & **Mean** \\ \hline PMA (x5\({}_{n,1}\),150) & 11,558 & 7.69 & 12.31 & 9.324 \\ PMA (x6\({}_{n,1}\),150) & 11,558 & 7.99 & 12.99 & 9.508 \\ \hline \end{tabular}
\end{table}
Table 4: Descriptive statistics of prior moving averages for real and simulated torque signals.  
Figure 6: Prior moving average comparison of torque signals with dynamic anomaly-threshold boundary of +25% relative to the simulated signal x6.  
11,355 rows of data from x1...x4 that are annotated as x1n,2...x4n,2. The data set-input variables for the simulation model are presented in Equation (3) as:  
\[\text{DS2}_{\text{input}}=\begin{bmatrix}x1_{1,2}&x2_{1,2}&x3_{1,2}&x4_{1,2}\\ \ldots&\ldots&\ldots&\ldots\\ x1_{11355,2}&x2_{11355,2}&x3_{11355,2}&x4_{11355,2}\end{bmatrix} \tag{3}\]  
The simulation process was scrutinized for all potential data sets containing anomalous data, yet only one of the data sets showed threshold-exceeding values. The data points exceeding the dynamic anomaly threshold are visualized in Figure 7, where the PMA150-averaged real signal x5 exceeds the simulated-signal threshold within five different time intervals.  
The anomaly occurrences in Figure 7 are labeled with yellow triangular symbols to showcase the x5 trendline points exceeding the dynamic anomaly threshold of +25% [x6n, 2 \(\times\) 1.25]. Due to the DS2 data set being the only one showing quantified deviations to the simulated signal, a conclusion of credible anomaly data detection and labeling is justifiable. The details of the different real anomaly (RA) labels and the anomaly-label data set average deviation relative to the dynamic threshold limit are shown in Table 5.  
Following the physics-based anomaly detection, the total number of anomalies labeled in the DS2 data set encloses a total of 2017 RA labels (17.8% of the total data points in DS2) and 9338 RN labels (82.2%). To conclude the labeling process, the DS2 data set normal and anomaly states are summarized in Table 6.  
Figure 7: Detected anomaly label areas (numbers 1–5) according to the simulation-model threshold limits.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \begin{tabular}{c} **Anomaly** \\ **Label** \\ \end{tabular} & \begin{tabular}{c} **Start Label** \\ \end{tabular} & \begin{tabular}{c} **End Label** \\ \end{tabular} & \
\begin{tabular}{c} **Total Anomaly** \\ **Labels** \\ \end{tabular} &
\begin{tabular}{c} **Avg. Threshold Dev.** \\ **(\%)** \\ \end{tabular} \\ \hline
1 & 3049 & 4040 & 991 & 14.0 \\
2 & 7945 & 8058 & 113 & 11.9 \\
3 & 8320 & 8552 & 232 & 19.2 \\
4 & 8860 & 9445 & 585 & 19.8 \\
5 & 9678 & 9774 & 96 & 1.0 \\ \hline \multicolumn{5}{c}{Sum} & 2017 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Details of the identified RA labels in DS2 with average deviation percentage to the dynamic threshold limit.  
Hence, the output data set DS2 output from the RA diagnostics is written in Equation (4) as follows:  
\[\text{DS2}_{\text{output}}=\begin{bmatrix}y_{1,1}&x1_{1,2}&x2_{1,2}&x3_{1,2}&x4_{ 1,2}&x5_{1,2}&x6_{1,2}\\ \ldots&\ldots&\ldots&\ldots&\ldots&\ldots&\ldots\\ y_{11355,1}&x1_{11355,2}&x2_{11355,2}&x3_{11355,2}&x4_{11355,2}&x5_{11355,2}&x6_ {11355,2}\end{bmatrix} \tag{4}\]  
The data point state column is symbolized with the letter \(y\) in the data set DS2 output. The classification state of '0' is associated with 'normal' operation, whereas '1' indicates an anomaly in the operational behavior.  
In summary, the DS2 remain the only data set of the original six data sets where threshold-exceeding anomalies were discovered; therefore, the validity of the diagnostics labeling results remains reliable. Thus, the simulation model has been proven to accurately detect anomalous behavior using the dynamic threshold boundaries set for anomaly detection.