FastFlow 是一个基于二维归一化流的概率分布估计器。它可以用做任何的深度特征提取器的插件模块,比如ResNet 和 vision transformer, 用于无监督异常检测和定位。在训练阶段,FastFlow 学习将输入视觉特征转换位易于处理的分布;在推理阶段,它评估失败异常的可能性。
模型结构
1、特征提取模块
backbone 充当特征提取器,不需要训练,不需要更新参数 requires_grad==false。
2、norms 模块
对于 resnet,norms 是可训练的 LayerNorm。
3、flows模块
可逆神经网络。(参考FrEIA)
复现
环境:
# 先前环境: sudo pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
Resource:
论文解读:https://blog.csdn.net/qq_45700830/article/details/122690958
https://blog.csdn.net/weixin_46782905/article/details/119958725
https://blog.csdn.net/qq_35030874/article/details/122426454