Manuscript Offprint

arXiv:2608.22789

GuidedFlow: An Attention-Guided Framework for Anomaly Detection in Additive Manufacturing

Sosmita Paul, Krishna Roy

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Additive Manufacturing (AM) plays a vital role in the ongoing industrial revolution. However, quality control remains crucial and challenging due to printing defects or potential cyber-physical intrusions. Image or video-based anomaly detection is a key effort towards addressing these challenges. Various approaches have been explored in this domain, including reconstruction-based, embedding-based, and flow-based methods. Though normalizing flow-based methods address some of the core challenges of unforeseen defects and generalization while maintaining detection performance, existing approaches struggle with tiny/stringing defects common in 3D printing. In a small-data setting, this poses a limitation in generalization. To address these limitations, we propose GuidedFlow, a novel attention-guided normalizing flow model for anomaly detection and localization. GuidedFlow employs a pre-trained ResNet model, fine-tuned on the domain dataset. An attention-guided spatial and temporal flow framework models the dynamics across multiple scales and frames. A Spatio-Temporal Attention Network (SAN) enables the flow model to prioritize relevant contextual cues from input frames. We evaluate GuidedFlow on our AM3D-AD dataset, consisting of benign and anomalous real 3D printed object images and videos. We also conduct a comparative study using the MVTec-AD industrial image anomaly detection dataset. Experimental results demonstrate that GuidedFlow outperforms most of the state-of-the-art models with enhanced detection accuracy and AUROC.

1. Introduction

In modern industrial environments, particularly in additive manufacturing (AM), ensuring the reliability and safety of printed components remains crucial and challenging due to printing defects or potential cyber-physical intrusions [10]. Even minor surface flaws or internal structural defects can cause part failure, increased production costs, or safety risks. Consequently, reliable anomaly detection and quality assurance mechanisms are critical to the safe deployment of AM technologies. In this domain, video/image-based anomaly detection offers the advantage of capturing spatio-temporal patterns of defects, making it well-suited for monitoring dynamic processes during 3D printing.

Several video/image anomaly detection and localization approaches have been explored for industrial and manufacturing applications. Reconstruction-based methods [2, 17, 19, 28, 29, 33], such as autoencoders, generative adversarial networks (GANs) and diffusion models, learn to reconstruct benign samples and flag images with a high reconstruction error as anomalous. However, they often miss subtle or localized defects, especially when biased towards dominant regular patterns. Embedding-based methods [4, 23] aim to learn compact latent representations, modeling normal feature distributions and detecting deviations through feature similarity. While these approaches improve generalization, they may struggle in detecting context-dependent anomalies. Recently, flow-based methods [9, 14, 24, 32], particularly those based on normalizing flows, have attracted attention for their ability to estimate exact likelihoods and retain invertibility. These methods are well-suited for detecting unforeseen anomalies, as they model the full data distribution rather than just its lower-dimensional embedding. Despite recent advancements of existing flow-based approaches, they often fall short in detecting irregular anomalies, such as stringing or tiny layer inconsistency defects that are especially common in AM processes. These problems get worse in small-data settings, where learning feature distributions is difficult. Furthermore, most existing methods treat images or frames independently and do not incorporate temporal dynamics, which is often critical for accurate localization and early detection.

To overcome these limitations, we propose GuidedFlow, a novel attention-guided normalizing flow framework for anomaly detection in additive manufacturing. GuidedFlow integrates a ResNet-50 model with a spatio-temporal atten-tion network to extract relevant contextual features. GuidedFlow introduces a spatio-temporal attention guided flow model, enabling it to handle context-dependent anomalies. The multi-level flow blocks model appearance and structure across resolutions. By learning where and when to focus in the visual stream, GuidedFlow enhances sensitivity to small and localized defects. We evaluated GuidedFlow on our AM3D-AD dataset containing both benign and anomalous 3D-printed object images and videos. Additionally, we benchmark our model against state-of-the-art methods on the publicly available MVTec-AD [3] dataset, due to the limited availability of additive manufacturing datasets. The model demonstrates robust performance in both anomaly detection and localization with improved generalization compared to most of the baseline methods.

We summarize our contributions as follows: (i) we propose and develop GuidedFlow, a novel conditioned-flow framework for image and video anomaly detection and localization integrating attention-guided spatial and temporal flow; (ii) we introduce a spatio-temporal attention network (SAN) using multi-head self-attention to enhance sensitivity to spatial and contextual anomalies; (iii) we propose a real-world additive manufacturing anomaly detection dataset, AM3D-AD, containing 3D-printed object images and videos; and (iv) we perform a comprehensive evaluation of GuidedFlow on both the AM3D-AD and MVTec-AD datasets.

References (34)