Can rknn quantization break something in the model that affects the correctness of the AUPIMO calculation? #3164
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I duplicated this question in #3165 to make it more likely to be noticed. |
Beta Was this translation helpful? Give feedback.
-
|
I figured out my problem, I hope it will be useful to someone. If you look at the anomaly_map values obtained from the rknn int8 model, you can see that before the threshold > 0.5 occurs, the following values appear in the first row: Here you can see how the number 4.990260004997253418e-01 is repeated many times (including throughout the anomalous map). And in onnx fp32 there is no such repetition, there is a gradual increase and the range of values is wider: So it turns out that the PIMO curve simply cannot be constructed, because at different thresholds we get only 3 values of TPR, 0, 1.7742777979651163e-06 and 1. Therefore, the lower and upper limits of integration collapse into one number - 1.7742777979651163e-06, and for calculating AUPIMO we need a continuous section, and not 1 point, because AUPIMO is the area under the PIMO curve. Moreover, this behavior is absolutely normal for quantization, because during quantization the range of possible values is compressed. We need to fit the entire range of floating-point numbers from 0 to 1 into only 255 unique values, which means that when int8 numbers are dequantized, the following happens: Now I see 2 ways out of this whole situation:
|
Beta Was this translation helpful? Give feedback.

I figured out my problem, I hope it will be useful to someone.
If you look at the anomaly_map values obtained from the rknn int8 model, you can see that before the threshold > 0.5 occurs, the following values appear in the first row: