StevenLiuWen / ano_pred_cvpr2018

Official implementation of Paper Future Frame Prediction for Anomaly Detection -- A New Baseline, CVPR 2018
433 stars 126 forks source link

About Norm of Regular Score (Maybe better the performance) #27

Closed fjchange closed 5 years ago

fjchange commented 5 years ago

https://github.com/StevenLiuWen/ano_pred_cvpr2018/blob/d9b1a6094ada005d09206cad0544288b8f7e2410/Codes/evaluate.py#L416

As the code shows, the scores are normalized every video clips, which makes the anomaly standard vary at each clips. I make it norm for only one time for all the SCORES, and the result better than the paper with 85%+ AUC my_re-implementation

    `for i in range(num_videos):
        distance = psnr_records[i]
        #if NORMALIZE:
            #distance = (distance-distance.min())/distance.max()  # distances = (distance - min) / (max - min)
            #distance /= distance.max()
            # distance = 1 - distance

        scores = np.concatenate((scores, distance[DECIDABLE_IDX:]), axis=0)
        labels = np.concatenate((labels, gt[i][DECIDABLE_IDX:]), axis=0)

    if NORMALIZE:
        scores-=scores.min()
        scores/=scores.max()

`

zachluo commented 5 years ago

@fjchange Thanks for pointing that. We also observed this trick, but found it favors different papers. So here we take the same normalization on all of our papers.