Research Article

Multiworking Conditions Anomaly Detection of Mechanical System Based on Conditional Variational Auto-Encoder

Algorithm 1

Threshold learning algorithm.
Input: Trained CVAE model, , , ; Testing data set working condition  =  abnormal label  =  , ;
Output: best_threshold: ()
 scores  score() # get anomaly score by equation (7)
 for i = 1 to C
   =  #get index by
  Si  scores [wi_ind]
   [wi_ind]
  t = 0.01
  while t < 1 do
   Ai_pred  Si > t
   best_t F1-score (Ai, Ai_pred, Si)
   t = t + 0.01
  end while
   #best threshold for
 end for