jx-zhong-for-academic-purpose / GCN-Anomaly-Detection

Source codes of our paper in CVPR 2019: Graph Convolutional Label Noise Cleaner: Train a Plug-and-play Action Classifier for Anomaly Detection
234 stars 44 forks source link

About run extract_c3d_all.py #10

Closed poweryin closed 5 years ago

poweryin commented 5 years ago

Hi,Thanks for I compiled the caffe in extract_c3d successfully, and when I run extract_c3d_all.py, I get an error:

1:42:47.985507 21269 upgrade_proto.cpp:928] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: /home/z840/GCN-Anomaly-Detection-master/c3d_deploy.prototxt Check failure stack trace: Setting device 0 [libprotobuf ERROR google/protobuf/text_format.cc:274] Error parsing text-format caffe.NetParameter: 31:16: Non-repeated field "kernel_size" is specified multiple times. WARNING: Logging before InitGoogleLogging() is written to STDERR F0716 21:42:48.657341 21302 upgrade_proto.cpp:928] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: /home/z840/GCN-Anomaly-Detection-master/c3d_deploy.prototxt Check failure stack trace: I don't know where this problem is.Do you give me some advice? Thanks Best wishes

jx-zhong-for-academic-purpose commented 5 years ago

The ‘"kernel_size" is specified multiple times’ problem should not occur if you use https://github.com/yjxiong/caffe/blob/3D. If such a problem remains, you can try the form "kernel_size: [3, 3, 3]" as in https://github.com/yjxiong/caffe/blob/3D/models/C3D/train.prototxt.

poweryin commented 5 years ago

Thank you for your reply. I downloaded caffe-3D from https://github.com/yjxiong/caffe/tree/3D ,This link https://github.com/yjxiong/caffe/blob/3D is not available. I try the form "kernel_size: [3, 3, 3] in c3d_deploy.prototxt"eg layer { name: "conv1a" type: "Convolution" bottom: "data" top: "conv1a" param { lr_mult: 0 decay_mult: 0 } param { lr_mult: 0 decay_mult: 0 } convolution_param { num_output: 64 kernel_size: [3,3,3] pad: [1,1,1] weight_filler { type: "gaussian" std: 0.01 }

and I got another error: [libprotobuf ERROR google/protobuf/text_format.cc:274] Error parsing text-format caffe.NetParameter: 30:18: Expected integer.(The line where the kernel is located) WARNING: Logging before InitGoogleLogging() is written to STDERR

I am confused.My C3D build environment is ubuntu16.04+python2.7+cuda8.0+opencv3.3

jx-zhong-for-academic-purpose commented 5 years ago

You can download our home-brewed caffe source code at: https://pan.baidu.com/s/1xmmlKYRu3Vd6FrzCeG1xng password: 9tq7

poweryin commented 5 years ago

Thank you for your detailed reply. This error did not appear again, I tested it with some video of UCF_Crimes dataset, eg.Fighting003_x264.mp4, and finally its frame_scores shape is (194,10,1), there are a total of 194 snippets, each snippet corresponding to 10 scores. The first snippet score is [[ 0.22232758] [-1.0004482 ] [ 0.93949014] ... [ 1.062814 ] [-0.89625275] [ 0.116637 ]] I don't understand why the scores in the same snippet have different signs. What does the minus sign mean? In order to more intuitively see the location of the anomaly, I used three methods to draw the picture.

  1. Min-Max Scaling. Add all the 10 scores corresponding to each snippet to the mean, and then take the absolute value as the score corresponding to the snippet.
  2. Select the highest score in the 10 scores as the value corresponding to the snippet.(Consider the sign)
  3. Select the lowest score in the 10 scores as the value corresponding to the snippet. (Consider the sign) The pictures are as follows: Fighting003_x264_average Fighting003_x264_max Fighting003_x264_min Green line is GT.I am confused, I can't get information from this picture, I don't know which part of my problem is wrong. Can you give me some advice? Looking forward to your reply Best Wishes
jx-zhong-for-academic-purpose commented 5 years ago

The Sigmoid function can be used to output the probability.

poweryin commented 5 years ago

The sigmoid is still a kind of linear transformation near the origin, and the change of the experimental results is not obvious. How do you measure the final score of a snippets by 10 scores corresponding to a snippet? I think it is maybe because the improper handling of this part leads to poor results.Still need additional data preprocessing? Best wishes

jx-zhong-for-academic-purpose commented 5 years ago

Take the average/median, and feed into a sigmoid activation. For some types of abnormalities, it may not work well. There is still much room for improvement, but for some other categories, it is good enough.

poweryin commented 5 years ago

Thank you for your answer, I get it. can you share your evaluation code? I want to see the results of the experiment. Best Wishes

jx-zhong-for-academic-purpose commented 5 years ago

You can refer to https://github.com/WaqasSultani/AnomalyDetectionCVPR2018/blob/master/Evaluate_Anomaly_Detector.m Ours is almost the same

poweryin commented 5 years ago

Thanks for your prompt reply very much.I truly appreciate your help in resolving the problems. Best Wishes

jx-zhong-for-academic-purpose commented 5 years ago

The training codes are also released. Best wishes~

Beyond-Zw commented 4 years ago

@poweryin Hi, when I run the extract_c3d_all.py, I got the same error as you. Could you tell me how you solved it in the end? Looking forward to you reply. Best wishes~