anomalib icon indicating copy to clipboard operation
anomalib copied to clipboard

Improper Normalization for CFlow-AD

Open marco-rudolph opened this issue 2 years ago • 2 comments

Hi! I would like to point out that the aggregation of the feature maps for CFlow-AD appears to be improper, since the relative weighting of the individual maps depends on the test set. Here is a reference issue: https://github.com/gudovskiy/cflow-ad/issues/24 The described problem occurs at this point: https://github.com/openvinotoolkit/anomalib/blob/8c1a04fc7fbd95fae1dac6cb0641a7381ec8e5d4/anomalib/models/cflow/model.py#L83 The normalization should be done after aggregating the individual feature maps. However, since this is not provided by the authors in the paper, it is unclear how to deal with this.

marco-rudolph avatar Mar 28 '22 15:03 marco-rudolph

Hi @marco-rudolph, thanks for spotting this! We'll also have a look at it from our side. Cheers!

samet-akcay avatar Mar 31 '22 14:03 samet-akcay

@marco-rudolph summing the scores before normalization leads to poor performance (as you also mentioned in the other thread). However, I don't understand relative weighting of individual maps. Do you mean storing the max value from the training set for each pooling layer and use it to normalize each layer before summing it?

ashwinvaidya17 avatar Sep 27 '22 12:09 ashwinvaidya17