All models

MemAE

A 3D convolutional autoencoder for video that reconstructs clips from a sparse readout of 2000 learned memory items.

Video · 45 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (41 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Task
Video
Parameters
6.5M
Operations
45
Framework
PyTorch
Recurrent
No
Published
ICCV 2019
Cited by
1,928 (as of 27 October 2026)
Authors
Dong Gong, Lingqiao Liu, Vuong Le and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m18393
Graph hash
f2a39e918f97d4a0c42e73b125f9c4cee8aab0c02e9b61362a0a8571234cf183
Skeleton hash
6dec732dd163a9ac411f4d60fab3eb9fe9f9bc500474370fcff33e5e1bc51273
Architecture hash
d5ba1debe4584fd22a02b9f0b361738f44fd9d2e7652495aae78f18a951e6ac9
Diagram SHA-256
c6b104c31069b660faf6cbd99bfe391d039ac961c502c994c4e2c2c72f5d46d1
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

MemAE, the memory-augmented autoencoder, is a deep autoencoder with a memory module, built for unsupervised anomaly detection. An autoencoder trained on normal data is expected to produce higher reconstruction error for abnormal inputs than for normal ones, which serves as the criterion for identifying anomalies. The paper observes that an autoencoder sometimes generalizes so well that it also reconstructs anomalies well, which then go undetected.

Given an input, MemAE does not feed its encoding directly into the decoder but uses it as a query to retrieve the most relevant items in the memory. The addressing scheme computes attention weights from the similarity of the memory items and the query. A differentiable hard shrinkage operator induces sparsity in those weights. In training, the memory content is updated with the encoder and decoder. At test time the learned memory is fixed, so the reconstruction comes from a few memory records of normal data and tends to be close to a normal sample.

For video, the encoder and decoder use 3D convolutions to extract spatial-temporal features. The input is a cuboid of 16 neighboring grayscale frames. Each memory slot records the features on one pixel in the feature maps, and the memory is a matrix of 2000 × 256. The paper runs this model on three video anomaly detection datasets: UCSD-Ped2, CUHK Avenue and ShanghaiTech. In testing, the normality of each frame is evaluated by the reconstruction error of the cuboid centered on it.

Key idea. MemAE uses an autoencoder's encoding as a query to retrieve the most relevant items of a learned memory and reconstructs the input from those items.

  • memae
  • memory-augmented autoencoder
  • memory-augmented deep autoencoder
  • unsupervised anomaly detection
  • video anomaly detection
  • anomaly detection
  • memory module
  • sparse addressing
  • reconstruction error

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{gong2019memorizingnormalitydetectanomaly,
      title={Memorizing Normality to Detect Anomaly: Memory-augmented Deep Autoencoder for Unsupervised Anomaly Detection}, 
      author={Dong Gong and Lingqiao Liu and Vuong Le and Budhaditya Saha and Moussa Reda Mansour and Svetha Venkatesh and Anton van den Hengel},
      year={2019},
      eprint={1904.02639},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1904.02639}, 
}