cvlab-yonsei / MNAD

An official implementation of "Learning Memory-guided Normality for Anomaly Detection" (CVPR 2020) in PyTorch.
333 stars 82 forks source link

a question about the code of calculating the accuracy #24

Open TanMing11 opened 3 years ago

TanMing11 commented 3 years ago

In the Evaluate.py ,there is a code : accuracy = AUC(anomaly_score_total_list, np.expand_dims(1-labels_list, 0)) When label is 0 , the input is Normal why there is: 1-label_list ?

Fly2flies commented 3 years ago

In the Evaluate.py ,there is a code : accuracy = AUC(anomaly_score_total_list, np.expand_dims(1-labels_list, 0)) When label is 0 , the input is Normal why there is: 1-label_list ?

Maybe it's because the way anomaly_score is calculated goes against common sense. a anomaly sample has low PSNR and high feature_distance, and in the codes block anomaly_score_total_list += score_sum(anomaly_score_list(psnr_list[video_name]), anomaly_score_list_inv(feature_distance_list[video_name]), args.alpha) the anomaly score of a anomaly frame is 0.

Let me know if I was wrong.

xiximin commented 3 years ago

If I only use PSNR, I don't use feature distance. So does the code just need to be deleted anomaly_score_list_inv(feature_distance_list[video_name])。 the code is :anomaly_score_total_list += anomaly_score_list(psnr_list[video_name])

xiximin commented 3 years ago

In the Evaluate.py ,there is a code : accuracy = AUC(anomaly_score_total_list, np.expand_dims(1-labels_list, 0)) When label is 0 , the input is Normal why there is: 1-label_list ?

Maybe it's because the way anomaly_score is calculated goes against common sense. a anomaly sample has low PSNR and high feature_distance, and in the codes block anomaly_score_total_list += score_sum(anomaly_score_list(psnr_list[video_name]), anomaly_score_list_inv(feature_distance_list[video_name]), args.alpha) the anomaly score of a anomaly frame is 0.

Let me know if I was wrong.

If I only use PSNR, I don't use feature distance. So does the code just need to be deleted anomaly_score_list_inv(feature_distance_list[video_name])。 the code is :anomaly_score_total_list += anomaly_score_list(psnr_list[video_name])