背景
当今制造业蓬勃发展,产品质量把控至关重要。从精密电子元件到大型工业板材,表面缺陷哪怕细微,都可能引发性能故障或外观瑕疵。人工目视检测耗时费力且易漏检,已无法适应高速生产线节奏。在此背景下,表面缺陷异常值检测技术应运而生,为保障产品质量筑牢根基。
在工业 4.0 浪潮下,各行业制造精度与速度飙升。汽车、3C 产品等领域,零部件表面质量直接关联成品性能与市场竞争力。然而,传统检测手段难应对复杂工艺下的微小缺陷。EfficienetAD 表面缺陷异常值检测技术应需登场,凭借高效精准算法,突破瓶颈,助力企业严守质量关。
本文以磁砖表面为例,说明异常值检测算法EfficienetAD的应用
工程戳这里获取,含模型
数据集
Baidu Netdisk 提取码:8888
data
├── test
│ ├── crack
│ ├── glue_strip
│ ├── good
│ ├── gray_stroke
│ ├── oil
│ └── rough
└── train
└── good
训练
python abnormalnet.py --type train
训练输出
epoch 386,current batch loss 2.834839, total loss: 764.140365, best loss: 539.619580, best epoch: 357, lr: 0.000859: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.68it/s]
epoch 387,current batch loss 2.765792, total loss: 580.103407, best loss: 539.619580, best epoch: 357, lr: 0.000828: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 56.39it/s]
epoch 388,current batch loss 2.763565, total loss: 547.897930, best loss: 539.619580, best epoch: 357, lr: 0.000105: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.39it/s]
epoch 389,current batch loss 3.261899, total loss: 566.002666, best loss: 539.619580, best epoch: 357, lr: 0.000216: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 56.52it/s]
epoch 390,current batch loss 3.099142, total loss: 631.268924, best loss: 539.619580, best epoch: 357, lr: 0.000926: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.32it/s]
epoch 391,current batch loss 2.652505, total loss: 564.764595, best loss: 539.619580, best epoch: 357, lr: 0.000737: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.40it/s]
epoch 392,current batch loss 2.483046, total loss: 537.808009, best loss: 539.619580, best epoch: 357, lr: 0.000048: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.93it/s]
Intermediate map normalization: 100%|███████████████████████████23/23 [00:00<00:00, 24.16it/s]
Intermediate inference: 100%|████████████████████████████| 117/117 [00:03<00:00, 32.69it/s]
Intermediate image auc: 100.0000
epoch 393,current batch loss 2.791982, total loss: 582.599108, best loss: 537.808009, best epoch: 392, lr: 0.000312: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.78it/s]
epoch 394,current batch loss 2.874834, total loss: 735.932301, best loss: 537.808009, best epoch: 392, lr: 0.000973: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.20it/s]
epoch 395,current batch loss 2.617457, total loss: 565.374229, best loss: 537.808009, best epoch: 392, lr: 0.000636: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.27it/s]
epoch 396,current batch loss 2.653447, total loss: 544.357111, best loss: 537.808009, best epoch: 392, lr: 0.000012: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 56.21it/s]
epoch 397,current batch loss 3.644118, total loss: 593.403939, best loss: 537.808009, best epoch: 392, lr: 0.000418: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.94it/s]
epoch 398,current batch loss 3.141065, total loss: 634.366765, best loss: 537.808009, best epoch: 392, lr: 0.000997: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 55.15it/s]
epoch 399,current batch loss 2.824724, total loss: 543.553844, best loss: 537.808009, best epoch: 392, lr: 0.000528: 100%|████████████████████████████████████████████████| 207/207 [00:03<00:00, 56.30it/s]
测试auc值
python abnormalnet.py --type auc
输出
load weights from: output/best.pkl
Inference: 100%|████████████████| 117/117 [00:06<00:00, 18.17it/s]
Image auc: 100.0000
单张测试
python abnormalnet.py --type test -i data/test/crack/001.png
示例1:
示例2:
示例3: