Detecting defects in industrial products quickly and accurately is crucial for maintaining quality and safety. However, traditional AI systems often require large amounts of defect-free images to learn what “normal” looks like, which isn’t always practical in real-world settings. A newly published research paper introduces Flownomaly, an innovative approach that significantly improves anomaly detection even when only a few normal images are available. This advancement could help industries spot defects faster and with less data, potentially reducing waste and costs.
Key Takeaways
- Flownomaly excels at identifying anomalies using just a handful (1 to 4) of defect-free images, known as few-shot learning.
- It achieves state-of-the-art accuracy on popular industrial anomaly detection benchmarks, outperforming previous methods by up to 2.1 percentage points in some cases.
- The method recovers a “clean” version of image features by learning to map noisy data back to normal patterns using a technique called conditional flow matching.
- Flownomaly works without needing any examples of defective images for tuning, relying solely on normal data to detect anomalies.
The core challenge in few-shot anomaly detection is teaching an AI system what normal product images look like when only very limited examples are available. Flownomaly approaches this by focusing on the “normal counterpart recovery” problem. Instead of comparing new images directly to stored examples or using rigid models, it operates in a special feature space derived from a powerful pretrained AI model called DINOv2. This feature space breaks down images into smaller patches, each represented as a vector of numbers capturing visual patterns.
Flownomaly then learns a “velocity field” — think of it as a guide showing how to move from random noise toward these normal feature patches. This is done through a process called conditional flow matching, which trains the system to transform noisy inputs into clean, normal features in a single step. The key innovation is that this recovery step gives the best estimate (posterior mean) of what a normal patch should look like without needing to simulate a long sequence of transformations. By comparing the difference between the recovered normal features and the actual observed features, the system identifies anomalies both at the image level and down to individual pixels.
Another practical aspect of Flownomaly is how it chooses how strongly to apply this recovery step. Since no defective samples are available to tune this parameter, the method uses a mathematical criterion based only on the normal data—specifically, a Jacobian gain-to-noise ratio—to select the optimal operating time. This makes the method more robust and easier to deploy in real industrial scenarios where defective examples are rare or unavailable.
In extensive tests on well-known datasets like MVTec-AD and VisA, which are standard benchmarks for industrial anomaly detection, Flownomaly consistently outperformed recent category-specific methods. For instance, in the challenging 1-shot setting where only a single normal image is provided, it achieved image-level accuracy (AUROC) of 97.8% and pixel-level accuracy of 98.0% on MVTec-AD, with similarly strong results on VisA. These improvements could translate into earlier and more reliable detection of defects on production lines.
Looking ahead, Flownomaly’s approach of leveraging pretrained feature spaces combined with efficient recovery of normal patterns could be adapted to other domains needing anomaly detection with limited data. Its reliance on normal-only data for tuning also reduces the barrier to practical deployment. While the research is still new, the publicly available code means developers and companies can start experimenting with it soon, potentially bringing smarter and more data-efficient quality control to manufacturing and beyond.
Based on research published on arXiv by Bernardo Perrone Ribeiro, Erkut Akdag, Egor Bondarev.
