# Improving Deep Learning Anomaly Diagnostics with a Physics-Based Simulation Model
## 3 Physics-Based Simulation Modeling and Anomaly Detection
### Anomaly Threshold Classification Criteria  
Despite the similarity obtained for the mean values, the boundaries for distinguishing between normal and abnormal behaviors are complex without absorbing the peak signals naturally produced by real-life applications. In the case set up with an electric motor as a torque generator, the starting torque ramp can cause load peaks when the motor starts from a standstill to obtain full-load speed. High peak currents and transient torque levels are commonly experienced during direct online starting [20]. Starting torque ramp is a type of torque control used to increase the torque of an electric motor in a linear fashion, which allows the motor to start up safely and with minimal stress on the system. Due to the aforementioned noise-increasing variables, the prior moving average (PMA) function is applied to reduce the x5 signal's low and high peak values yet minimize the effect on the mean signal amplitude. Prior moving average is a statistical term that refers to the average of a set of data from a preceding period [21], in this case, containing the average value of the previous 150 data points. The PMA procedure simultaneously adds hysteresis to the observed variable, resulting in a more consistent trend curve by reducing the size of individual peak values crossing the threshold boundary. Hysteresis is considered a control  
Figure 5: Simulated torque signal comparison to the real torque with moving average trend.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Signal** & **N** & **Minimum** & **Maximum** & **Mean** \\ \hline x5\({}_{\text{n,1}}\) & 11,708 & 4.440 & 15.350 & 9.328 \\ x6\({}_{\text{n,1}}\) & 11,708 & 7.980 & 13.485 & 9.506 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Descriptive statistics of real and simulated raw torque signals.  
system technique where the relationship between input and output variables involves memory effects [22]; therefore, it reduces sensitivity to noise or time lag [23]. To summarize, hysteresis helps to reduce time delays and to eliminate sharp fluctuations in system output, leading to more reliable and stable performance. Table 4 illustrates the changes to the minimum and maximum values of the trends from the PMA averaging that has only a small effect on the mean values. A small decrease in the total number of data points (N) is due to the fact that the PMA function considers the prior averaging of 150 data points, which is equivalent to 30 s of operation. Therefore, the first value in the data set is appointed at \(n=151\).  
To address the natural milling-recipe changes in the simulation input variables (x1...x4), the threshold boundary for the anomaly distinguishing requires dynamic adjustment to the simulated signal. A dynamic threshold will allow the system to convey functional changes in the milling process and to adjust the threshold boundary accordingly without falsely detecting increased signal values as anomalistic behavior. However, determining the exact threshold limit is cumbersome due to the fact that the threshold for a dynamic torque anomaly can vary depending on the specific motor type, size, age, and environment. It has been discovered by [24] that variation in torque can be caused only by the rotor position changing by approximately 20% in normal conditions with a conventional control strategy. Therefore, combining the knowledge from previous research and from this study's experiments, the anomalistic threshold boundary is set to +25% in comparison to the x6 excitation received from the simulation model. The dynamic threshold is tested with the PMA-averaged data set DS1 output as presented in Figure 6, which shows no single data point crossing the dynamic threshold.