当前位置: 首页 > news >正文

【2022工业图像异常检测文献】CFLOW-AD: 通过条件归一化流实现实时无监督定位异常检测

CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows

1、Background

虽然最近提出针对此类数据设置的模型在准确性指标上取得了很高的成绩,但它们的复杂性限制了实时处理的能力。

CFLOW-AD由一个经过判别式预训练的编码器组成,后面跟着一个多尺度生成解码器,后者明确估计编码特征的似然性。

该方法得到了一个计算和内存高效的模型: CFLOW-AD在相同的输入设置下,比之前的最先进模型快10倍,小10倍。

2、Method

在这里插入图片描述

在这里插入图片描述

pseudo-code

# 输入: 训练数据 Dtrain, 测试数据 Dtest
# 输出: 异常检测和定位的结果# Step 1: 特征提取
def feature_extraction(image):# 使用预训练的CNN作为编码器encoder = pretrained_cnn()feature_maps = encoder(image)return feature_maps# Step 2: 多尺度特征金字塔池化
def pyramid_pooling(feature_maps):pooled_features = []for scale in scales:pooled_feature = pool(feature_maps[scale])pooled_features.append(pooled_feature)return pooled_features# Step 3: 条件归一化流
def conditional_normalizing_flows(pooled_features, conditions):decoders_outputs = []for k, pooled_feature in enumerate(pooled_features):decoder = train_cflow_decoder(pooled_feature.shape)likelihood = decoder(pooled_feature, conditions[k])decoders_outputs.append(likelihood)return decoders_outputs# Step 4: 多尺度融合
def multi_scale_fusion(decoders_outputs):anomaly_map = sum(upsample(decoder_output) for decoder_output in decoders_outputs)return anomaly_map# Step 5: 阈值处理和异常定位
def thresholding(anomaly_map, threshold):binary_map = anomaly_map > thresholdreturn binary_map# 训练阶段
def train(model, Dtrain):for image in Dtrain:features = feature_extraction(image)conditions = get_conditions(features)model = update_model(features, conditions)return model# 测试阶段
def test(model, Dtest):anomalies = []for image in Dtest:features = feature_extraction(image)conditions = get_conditions(features)decoders_outputs = conditional_normalizing_flows(features, conditions)anomaly_map = multi_scale_fusion(decoders_outputs)threshold = determine_threshold(anomaly_map)binary_map = thresholding(anomaly_map, threshold)anomalies.append(binary_map)return anomalies# 主函数
def main(Dtrain, Dtest):model = train(Dtrain)test_results = test(model, Dtest)return test_results# 运行模型
Dtrain = load_training_data()
Dtest = load_testing_data()
results = main(Dtrain, Dtest)

3、Experiments

在这里插入图片描述

4、Conclusion

提出了一种结合多尺度特征提取和条件归一化流的异常检测CFLOW-AD模型


http://www.mrgr.cn/news/42566.html

相关文章:

  • 深入理解Dubbo源码核心原理-Part3
  • (C语言贪吃蛇)15.贪吃蛇吃食物
  • fiddler抓包17_简单接口测试(Composer请求编辑)
  • fastAPI教程:进阶操作
  • 创建django项目,编译类型选择Custom environment后,却没有manage.py文件,无法启动项目?
  • 古典舞在线互动:SpringBoot平台设计与功能实现
  • 论文翻译 | Language Models are Few-Shot Learners 语言模型是少样本学习者(下)
  • LeetCode题练习与总结:整数转换英文表示--273
  • 知识图谱入门——8:KG开发常见数据格式:OWL、RDF、XML、GraphML、JSON、CSV。
  • 36 指针与 const 的多种搭配:指向常量的指针、常量指针、指向常量的常量指针、指针到指针的常量(涉及双重指针)
  • 插入排序:直接插入排序、希尔排序
  • Java高效编程(15):最小化类与成员的可见性
  • 5G NR coreset 简介
  • (C语言贪吃蛇)16.贪吃蛇食物位置随机(完结撒花)
  • Ubuntu18.04配置OpenPCDet并运行demo过程记录
  • Chromium 硬件加速开关c++
  • Redis: 集群高可用之MOVED转向和ASK转向解决方案
  • [云] DockerCoins 练习笔记
  • 电子电路元件器介绍与选型——晶振
  • 基于Apache和Tomcat的负载均衡实验报告