Source-linked AI summary
GuidedFlow: An Attention-Guided Framework for Anomaly Detection in Additive Manufacturing
Sosmita Paul, Krishna Roy
TL;DR
Additive manufacturing anomaly detection must address defects and intrusions while existing flow-based methods remain limited for tiny printing defects and small-data generalization. GuidedFlow uses a pretrained ResNet-50 with spatio-temporal attention-conditioned flow across multiple scales and frames, and evaluation reports consistent detection performance across AM3D-AD and MVTec-AD. The authors conclude that the framework improves anomaly detection and localization relative to most baselines, with complementary spatial and temporal cues producing the strongest ablation results.
Problem
Reliable additive-manufacturing quality control is challenging, and existing flow-based methods can struggle with tiny defects such as stringing, creating a generalization challenge.
Method
GuidedFlow combines hierarchical pretrained ResNet-50 features with spatio-temporal attention-conditioned normalizing flow across multiple resolutions and frames.
Results
GuidedFlow demonstrates consistent image- and video-based anomaly detection performance on AM3D-AD and MVTec-AD and improved generalization compared with most baselines.
Takeaways & Limitations
Combining spatial and temporal attention yields complementary cues, with the GuidedFlow architecture reaching V-AUROC 98.7 and P-AUROC 98.9 in the ablation study.
Takeaways & Limitations
Effectiveness is reduced for some classes, and evaluation is limited to a small number of publicly available additive-manufacturing datasets.
Abstract
from arXiv · showhide
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 \textbf{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
Additive manufacturing quality control is challenging because defects and cyber-physical intrusions can compromise printed components, while image/video anomaly detection captures spatio-temporal defect patterns. GuidedFlow addresses limitations of existing approaches with attention-guided spatial and temporal flow, evaluated on AM3D-AD and MVTec-AD.
- Printing defects and cyber-physical intrusions make reliable quality assurance essential for safe additive manufacturing deployment.Even minor surface or internal defects can cause part failure, higher production costs, or safety risks.
- Image- and video-based anomaly detection is suited to 3D-printing monitoring because it captures spatio-temporal defect patterns.
- Reconstruction-based methods can miss subtle or localized defects when biased toward dominant regular patterns.The related approaches include autoencoders, GANs, and diffusion models that flag high reconstruction error.
- GuidedFlow combines a ResNet-50 model with spatio-temporal attention-guided flow to extract contextual features and handle context-dependent anomalies.Its multi-level flow blocks model appearance and structure across resolutions, focusing on where and when to detect small defects.
- The framework integrates attention-guided spatial and temporal flow, a multi-head self-attention SAN, and evaluation on AM3D-AD and MVTec-AD.AM3D-AD contains benign and anomalous 3D-printed object images and videos.
2. Related Work
Related work spans reconstruction, handcrafted and physics-based monitoring, transformers, contrastive learning, and flow-based methods for industrial anomaly detection. These approaches offer adaptability, scalability, or exact likelihood modeling, but challenges remain in generalization, computational cost, and sensitivity to tiny printing defects.
- Reconstruction-based unsupervised methods learn benign patterns and identify anomalies through deviations during reconstruction.Autoencoders and GAN-based approaches are used because anomalous samples are limited.
- Handcrafted-feature and physics-based systems can be less adaptive to unseen defect variations, while real-time deep models may require substantial computational resources.
- Deep unsupervised methods provide adaptability and precision, but generalization remains challenging under noisy or dynamically changing manufacturing conditions.
- Transformers model long-range dependencies with self-attention, while contrastive methods learn discriminative representations across industrial and additive-manufacturing anomaly tasks.Examples include VT-ADL, EVAL, CLEP, One-for-All, and DualAD.
- Flow-based methods model exact data likelihoods through invertible transformations and have been extended to spatial, temporal, hierarchical, and multi-scale settings.Diffusion methods can capture complex structures but may be computationally intensive and blur fine details needed for stringing-defect localization.
- Flow-based models can struggle with tiny printing defects because likelihood scoring may be misled by high-frequency backgrounds and pretrained features may lack task-specific semantic alignment.GuidedFlow addresses these challenges with hierarchical flow and spatio-temporal guidance.
3. Methodology
GuidedFlow extracts hierarchical ResNet features, uses SAN to encode spatio-temporal context, and processes those features with an attention-conditioned, multi-scale invertible flow for anomaly detection and localization.
- Architecture: GuidedFlow processes 224 × 224, 3-channel video clips by modeling multi-scale feature pyramids extracted from frames rather than raw pixels.The model is trained on benign data using a likelihood objective before identifying and localizing 3D-printing defects.
- Architecture: A pretrained ResNet-50 extracts hierarchical features from four layers, freezing f1 and f2 while training f3 and f4.The four layers have channel depths of 256, 512, 1024, and 2048, respectively.
- Spatio-Temporal Attention Encoding: SAN applies multi-head self-attention to ResNet features, combines attention-head outputs with scene embeddings, and produces conditioning attention for each frame.This conditioning captures spatial and temporal dependencies and focuses the flow on relevant regions across frame sequences.
- Guided Spatio-Temporal Flow Processing: GSTF uses a Laplacian pyramid and attention-conditioned invertible transformations to model spatial dependencies within frames and temporal dependencies across frames.Spatial flow transforms pyramid levels across scales, while temporal flow applies invertible coupling operations across the frame dimension.
- Guided Spatio-Temporal Flow Processing: The flow combines scale-specific spatial coupling and convolution with 3D temporal coupling guided by spatio-temporal attention.Its invertibility enables exact likelihood evaluation and fast likelihood-based anomaly scoring and localization.
- Anomaly Scoring and Localization: Anomaly scores are computed from the negative log-likelihood of transformed features, while localization aggregates per-location latent-energy and log-determinant contributions across pyramid levels.The aggregated contributions are upsampled to the input resolution to form a localization map.
4. Experiment
GuidedFlow is evaluated on AM3D-AD and MVTec-AD using image- and video-level anomaly detection, localization, comparative benchmarks, ablations, and hyperparameter analysis. Results show strong image and video performance, with complementary benefits from attention and spatial-temporal flow components.
- Dataset Details: AM3D-AD contains 537 images and 129 videos across five NylonX Carbon Fiber object categories, while MVTec-AD contributes 5,354 images across 15 categories.AM3D-AD anomalies were generated by sabotaging Gcode with redundant or noisy G0 and G1 motion commands.
- Evaluation Protocol: GuidedFlow evaluates image detection and localization with I-AUROC, P-AUROC, AUPRO, and I-AP, and video performance with V-AUROC.AUROC scores are reported as percentages, and benign samples are split into training and testing while anomalies are reserved for testing.
- Image Anomaly Detection: GuidedFlow achieves average I-AUROC 97.4, P-AUROC 96.8, AUPRO 0.93, and I-AP 0.95, outperforming the reported averages of DiffusionAD, INP-Former, and PyramidFlow.Lower P-AUROC occurs for selected classes including Cube and Block in AM3D-AD and Toothbrush and Tile in MVTec-AD.
- Video Anomaly Detection: GuidedFlow reaches V-AUROC values of 98.9 for Gear, 97.2 for Cube, and 98.6 for Block, with temporal attention leveraging contextual information across frames.The results are reported for the AM3D-AD video dataset and indicate temporal consistency across diverse object geometries and defect patterns.
- Ablation Study: Combining spatial and temporal attention yields the highest ablation performance, with V-AUROC 98.7 and P-AUROC 98.9.Spatial attention improves contextual localization, while temporal attention reinforces consistency across sequential frames.
- Ablation Study: Spatial and temporal flow variants achieve V-AUROC 95.3 and 94.6, while multi-resolution spatial and multi-frame temporal encoding improves sensitivity to fine stringing defects.The study reports that spatial flow contributes more directly to fine-grained localization, whereas temporal flow adds inter-frame relational context.
5. Limitations and Future Work
GuidedFlow has reduced effectiveness on classes with minimal pixel-wise anomaly deviation or highly repetitive textures, and its evaluation currently covers few public AM datasets.
- GuidedFlow is less effective for Block and Cube in AM3D-AD and Toothbrush and Tile in MVTec-AD.These classes contain anomalies with minimal pixel-wise deviation or highly repetitive textures.
- Evaluation is limited to a small number of publicly available additive manufacturing datasets.Future work will examine more datasets spanning diverse materials and printing conditions.
- Future work will explore domain-adaptive feature learning to improve robustness and generalizability.
6. Conclusion
GuidedFlow is an attention-guided spatio-temporal normalizing flow model for anomaly detection and localization in additive manufacturing images and videos. Evaluations on AM3D-AD and MVTec-AD show consistent performance across image- and video-based tasks.
- GuidedFlow detects and localizes anomalies in additive manufacturing images and videos using attention-guided spatio-temporal normalizing flows.
- The model processes hierarchical pretrained ResNet-50 features with spatio-temporal attention-conditioned flow operations across multiple resolutions and frames.
- GuidedFlow was evaluated on AM3D-AD, containing real 3D-printed object images and videos, and on the MVTec-AD baseline dataset.
- Experimental results demonstrate consistent performance in image-based and video-based anomaly detection tasks.