  Although existing image anomaly detection methods yield impressive results,
they are mostly an offline learning paradigm that requires excessive data
pre-collection, limiting their adaptability in industrial scenarios with online
streaming data. Online learning-based image anomaly detection methods are more
compatible with industrial online streaming data but are rarely noticed. For
the first time, this paper presents a fully online learning image anomaly
detection method, namely LeMO, learning memory for online image anomaly
detection. LeMO leverages learnable memory initialized with orthogonal random
noise, eliminating the need for excessive data in memory initialization and
circumventing the inefficiencies of offline data collection. Moreover, a
contrastive learning-based loss function for anomaly detection is designed to
enable online joint optimization of memory and image target-oriented features.
The presented method is simple and highly effective. Extensive experiments
demonstrate the superior performance of LeMO in the online setting.
Additionally, in the offline setting, LeMO is also competitive with the current
state-of-the-art methods and achieves excellent performance in few-shot
scenarios.
