Source-linked AI summary

Learning Memory-guided Normality for Anomaly Detection

Hyunjong Park, Jongyoun Noh, Bumsub Ham

arXiv:2003.13228v1cs.CV

TL;DR

Unsupervised video anomaly detection lacks an explicit way to represent diverse normal patterns. This paper uses a memory of normal-pattern prototypes, trained with compactness and separateness losses, and reports state-of-the-art performance on standard benchmarks.

  • Problem

    Unsupervised video anomaly detection methods do not explicitly account for the diversity of normal patterns.

    Source: §1 · p. 2
  • Method

    The approach uses a memory module of prototypical normal patterns, feature compactness and separateness losses, and a memory update scheme for test-time normal and abnormal samples.

    Source: §1 · p. 2
  • Results

    The model outperforms the state of the art on standard benchmarks for unsupervised video anomaly detection.

    Source: §1 · p. 2, §5 · p. 8
  • Takeaways & Limitations

    The reported training scheme separates memory items, enabling sparse access to the memory.

    Source: §5 · p. 8

Abstract

from arXiv · show

We address the problem of anomaly detection, that is, detecting anomalous events in a video sequence. Anomaly detection methods based on convolutional neural networks (CNNs) typically leverage proxy tasks, such as reconstructing input video frames, to learn models describing normality without seeing anomalous samples at training time, and quantify the extent of abnormalities using the reconstruction error at test time. The main drawbacks of these approaches are that they do not consider the diversity of normal patterns explicitly, and the powerful representation capacity of CNNs allows to reconstruct abnormal video frames. To address this problem, we present an unsupervised learning approach to anomaly detection that considers the diversity of normal patterns explicitly, while lessening the representation capacity of CNNs. To this end, we propose to use a memory module with a new update scheme where items in the memory record prototypical patterns of normal data. We also present novel feature compactness and separateness losses to train the memory, boosting the discriminative power of both memory items and deeply learned features from normal data. Experimental results on standard benchmarks demonstrate the effectiveness and efficiency of our approach, which outperforms the state of the art.

1. Introduction

The paper treats video anomaly detection as unsupervised modeling of normality and proposes a memory-guided approach that represents diverse normal patterns with multiple prototypes.

1. Introduction

  • Anomaly detection is typically unsupervised because anomalous events are context-dependent, costly to annotate, and rare in real-world data.At test time, events and activities not described by a model of normality are treated as anomalies.Source: §1 · p. 1
  • Reconstruction and prediction methods use proxy tasks and can reconstruct abnormal frames, while a single-center hypersphere approach does not represent varied normal patterns.CNN features from abnormal frames may be reconstructed by combining features of normal ones, resulting in low reconstruction error.Source: §1 · pp. 1–2
  • The approach outperforms the state of the art on UCSD Ped2, CUHK Avenue, and ShanghaiTech.The paper also reports effectiveness and efficiency on these standard benchmarks.Source: §1 · p. 2
  • A memory module represents diverse normal video patterns with multiple prototypical features, limiting CNNs to representations built from memory items.The paper assumes a single prototype cannot capture the multiple modes or centroids present in normal-frame feature space.Source: §1 · p. 2
  • Feature compactness pulls normal-frame features toward their nearest memory items, while feature separateness distinguishes the nearest from the second-nearest item.Together, the losses discourage a degenerate solution in which all memory items become similar and make features and items more discriminative.Source: §1 · p. 2
  • A weighted regular score estimates anomalies in each test frame, and the memory updates only when a frame is judged normal.This update scheme is intended to prevent memory items from recording anomalous samples at test time.Source: §1 · p. 2

2. Related work

Prior anomaly-detection work includes reconstructive and discriminative models, while CNN-based methods can reconstruct anomalous samples and predictive alternatives may incur extra costs. This work uses memory items as prototypes of normal patterns, with explicit separation and test-time updates.

  • Earlier unsupervised methods learn normality reconstructively with AEs, dictionaries, or generative models, or discriminatively with statistical boundaries, but may miss complex image and video distributions [3].Source: §2 · p. 2
  • CNN-based reconstructive methods outperform classical approaches but may reconstruct anomalies; prediction can mitigate this, though [22] requires optical-flow estimation and ground-truth flow for training.Source: §2 · p. 2
  • Unlike Deep SVDD [35], which maps normal data to a hypersphere center, this method reconstructs or predicts frames from memory-item combinations; unlike Deep-Cascade, it records normal patterns explicitly, including in test sequences.Its future-frame prediction avoids optical flow and is described as faster than [22].Source: §2 · p. 3
  • Memory items explicitly record diverse, discriminative normal patterns; feature compactness and separateness losses enable 10 items versus 2,000 for MemAE, and the memory updates at test time.The model also discriminates anomalies while updating, allowing it to memorize normal patterns in test data.Source: §2 · p. 3
  • Memory networks provide global read/write memory beyond compressed LSTM states, but this work applies them to anomaly detection by assigning normal patterns to individual prototypical items with a different update strategy.Source: §2 · p. 3

3. Approach

The approach uses a memory of prototypical normal patterns with an encoder-decoder and reconstruction, compactness, and separateness losses. At test time, it combines query-to-memory distances with reconstruction error to score abnormalities.

3. Approach

  • The encoder retrieves and updates prototypical normal patterns in a memory, whose read features guide frame reconstruction alongside the query features.The model is trained end-to-end with reconstruction, feature compactness, and feature separateness losses; a weighted regular score prevents memory updates from abnormal frames at test time.Source: §3 · p. 3

3.1.1 Encoder and decoder

  • The model uses a U-Net encoder-decoder with L2-normalized features; it removes encoder batch normalization and ReLU, and removes skip connections for reconstruction but retains them for future-frame prediction.For prediction, four successive frames are used to predict the fifth; the paper uses nearly the same architecture and losses for reconstruction and prediction.Source: §3 · p. 3, §3.1.1 · p. 4

3.1.2 Memory

  • Memory reads combine all items using query-to-item matching probabilities, while updates use weighted averages of queries assigned to each item.At test time, a weighted reconstruction-error score above threshold γ marks a frame abnormal and excludes it from memory updates; the weighting emphasizes regions with large reconstruction errors.Source: §3.1.2 · pp. 4–5

3.2. Training loss

  • Feature compactness pulls queries toward their nearest memory items, while feature separateness pushes the second-nearest item away to keep memory items distinct.The separateness loss uses the nearest item as a positive and the second-nearest as a hard negative, addressing the tendency of compactness alone to make all items similar.Source: §3.2 · pp. 5–6

3.3. Abnormality score

  • The final abnormality score sums min-max-normalized query-to-nearest-memory distance and reconstruction error measured by PSNR, balanced by λ.Abnormal frames are assumed to have queries dissimilar to normal-pattern memory items and low PSNR because their patterns are not reconstructed well.Source: §3.3 · p. 6

4. Experiments

Experiments compare the memory-guided models on three anomaly-detection benchmarks, reporting strong prediction results and faster inference alongside ablations and visualizations of the memory and feature losses.

4.1. Implementation details

  • The experiments use UCSD Ped2, CUHK Avenue, and ShanghaiTech, resizing frames to 256 × 256 and training end-to-end for 1, 15, and 36 hours, respectively.The setup uses 10 memory items and batch size 4, with 60, 60, and 10 training epochs for the three datasets, respectively.Source: §4.1 · p. 6

4.2. Results

  • Ours-P with memory achieves 97.0% AUC on UCSD Ped2 and 88.5% on CUHK Avenue, while Frame-Pred [22] outperforms it on ShanghaiTech.Frame-Pred [22] uses optical-flow and adversarial-learning modules; the paper reports 67 fps for its model versus 25 fps for Frame-Pred.Source: §4.2 · pp. 6–7, Table 1 · p. 7
  • Adding memory to prediction raises AUC by 2.7% on UCSD Ped2, 4.0% on CUHK Avenue, and 3.7% on ShanghaiTech.The authors report that memory boosts AUC regardless of task across all three datasets.Source: §4.2 · p. 7
  • Ours-R with memory is competitive with reconstructive methods on UCSD Ped2 and outperforms them on other datasets except MemAE [8].Ours uses 2D convolutions and 10 memory items of size 512, versus MemAE’s 3D convolutions and 2,000 items of size 256; the reported speeds are 67 fps and 45 fps, respectively.Source: §4.2 · p. 7
  • Inference takes 0.015 seconds per 256 × 256 image, or 67 fps, faster than Unmasking [41] at 20 fps, StackRNN at 50 fps, Frame-Pred [22] at 25 fps, and MemAE [8] at 45 fps.Source: §4.2 · p. 7

4.3. Discussions

  • On UCSD Ped2 reconstruction, feature compactness alone reduces AUC, while feature separateness raises it by 3.8%; the losses are complementary.The ablations also find that updating memory with normal-frame features at test time boosts AUC, and the abnormality score combining PSNR with memory items performs better than PSNR alone.Source: §4.3 · pp. 7–8, Table 2 · p. 8
  • Feature separateness makes query features activate only a few memory items and separates memory prototypes, while normal regions are predicted well and abnormal regions are highlighted.The qualitative examples show a vehicle, jumping, and a fight highlighted on UCSD Ped2, CUHK Avenue, and ShanghaiTech, respectively; using sixteen frames to reconstruct the ninth yields 91.0% AUC on UCSD Ped2, a 0.8% gain with about 4 MB more parameters.Source: §4.2 · p. 7, §4.3 · p. 8, Figure 5 · p. 8

5. Conclusion

The paper introduces an unsupervised video anomaly-detection approach that uses memory items to represent diverse normal patterns. Evaluations on standard benchmarks show that the model outperforms the state of the art.

  • The model outperforms the state of the art in extensive evaluations on standard benchmarks.Source: §5 · p. 8
  • The approach uses memory items to record multiple prototypes of normal data patterns for video anomaly detection.Source: §5 · p. 8
  • Feature compactness and separateness losses separate memory items, enabling sparse access to the memory.Source: §5 · p. 8
  • A new memory update scheme for settings with both normal and abnormal samples significantly boosts anomaly-detection performance.Source: §5 · p. 8
Loading 2003.13228v1…