Table of Contents
Fetching ...

PatchFlow: Leveraging a Flow-Based Model with Patch Features

Boxiang Zhang, Baijian Yang, Xiaoming Wang, Corey Vian

TL;DR

PatchFlow targets automated surface defect detection in die casting by combining local patch-based features with a streamlined normalizing flow. It introduces a lightweight feature adaptor and a bottlenecked coupling structure to map adapted patch representations to a standard normal distribution, enabling precise pixel-level localization and image-level anomaly scoring. Evaluations on MVTec AD, VisA, and a proprietary valve-die dataset show state-of-the-art image-level AUROC scores (e.g., 99.28% on MVTec AD and 96.48% on VisA) and substantial relative reductions in error compared to prior methods. The approach demonstrates strong practical potential for industrial inspection, achieving high accuracy without requiring anomalous training data in the proprietary dataset. Overall, PatchFlow advances anomaly detection by efficiently leveraging multi-scale, patch-aware features with a distribution-mapped flow for robust, localized defect detection in manufacturing contexts.

Abstract

Die casting plays a crucial role across various industries due to its ability to craft intricate shapes with high precision and smooth surfaces. However, surface defects remain a major issue that impedes die casting quality control. Recently, computer vision techniques have been explored to automate and improve defect detection. In this work, we combine local neighbor-aware patch features with a normalizing flow model and bridge the gap between the generic pretrained feature extractor and industrial product images by introducing an adapter module to increase the efficiency and accuracy of automated anomaly detection. Compared to state-of-the-art methods, our approach reduces the error rate by 20\% on the MVTec AD dataset, achieving an image-level AUROC of 99.28\%. Our approach has also enhanced performance on the VisA dataset , achieving an image-level AUROC of 96.48\%. Compared to the state-of-the-art models, this represents a 28.2\% reduction in error. Additionally, experiments on a proprietary die casting dataset yield an accuracy of 95.77\% for anomaly detection, without requiring any anomalous samples for training. Our method illustrates the potential of leveraging computer vision and deep learning techniques to advance inspection capabilities for the die casting industry

PatchFlow: Leveraging a Flow-Based Model with Patch Features

TL;DR

PatchFlow targets automated surface defect detection in die casting by combining local patch-based features with a streamlined normalizing flow. It introduces a lightweight feature adaptor and a bottlenecked coupling structure to map adapted patch representations to a standard normal distribution, enabling precise pixel-level localization and image-level anomaly scoring. Evaluations on MVTec AD, VisA, and a proprietary valve-die dataset show state-of-the-art image-level AUROC scores (e.g., 99.28% on MVTec AD and 96.48% on VisA) and substantial relative reductions in error compared to prior methods. The approach demonstrates strong practical potential for industrial inspection, achieving high accuracy without requiring anomalous training data in the proprietary dataset. Overall, PatchFlow advances anomaly detection by efficiently leveraging multi-scale, patch-aware features with a distribution-mapped flow for robust, localized defect detection in manufacturing contexts.

Abstract

Die casting plays a crucial role across various industries due to its ability to craft intricate shapes with high precision and smooth surfaces. However, surface defects remain a major issue that impedes die casting quality control. Recently, computer vision techniques have been explored to automate and improve defect detection. In this work, we combine local neighbor-aware patch features with a normalizing flow model and bridge the gap between the generic pretrained feature extractor and industrial product images by introducing an adapter module to increase the efficiency and accuracy of automated anomaly detection. Compared to state-of-the-art methods, our approach reduces the error rate by 20\% on the MVTec AD dataset, achieving an image-level AUROC of 99.28\%. Our approach has also enhanced performance on the VisA dataset , achieving an image-level AUROC of 96.48\%. Compared to the state-of-the-art models, this represents a 28.2\% reduction in error. Additionally, experiments on a proprietary die casting dataset yield an accuracy of 95.77\% for anomaly detection, without requiring any anomalous samples for training. Our method illustrates the potential of leveraging computer vision and deep learning techniques to advance inspection capabilities for the die casting industry
Paper Structure (20 sections, 5 equations, 5 figures, 5 tables)

This paper contains 20 sections, 5 equations, 5 figures, 5 tables.

Figures (5)

  • Figure 1: Visualization of per-pixel anomaly Groud Truth; heatmaps and predict anomaly mask
  • Figure 2: Model Overview. The PatchFlow model comprises four key components. 1, a pretrained feature extractor extracts multi-level representations from multi-scale images. 2, a feature aggregation layer combines descriptors from different hierarchical levels and scales. 3, a feature adapter module reduces the dimensionality of the representations and bridges the gap between the generic pretraining data and specialized industrial product images. 4, a normalizing flow maps the adapted features to a standardized distribution.
  • Figure 3: The coupling block features a bottleneck structure, where 'FC' and 'BN' refer to the fully connected layer and bottleneck layer.
  • Figure 4: Demonstration of collected valve body data. The valve body data used for demonstration was collected with synthesized defects randomly generated by placing nails on the valve surface.
  • Figure 5: Defect localization heatmaps for valve body images. Brighter green regions indicate areas with higher anomaly scores.