  Unsupervised anomaly detection models which are trained solely by healthy
data, have gained importance in the recent years, as the annotation of medical
data is a tedious task. Autoencoders and generative adversarial networks are
the standard anomaly detection methods that are utilized to learn the data
distribution. However, they fall short when it comes to inference and
evaluation of the likelihood of test samples. We propose a novel combination of
generative models and a probabilistic graphical model. After encoding image
samples by autoencoders, the distribution of data is modeled by Random and
Tensorized Sum-Product Networks ensuring exact and efficient inference at test
time. We evaluate different autoencoder architectures in combination with
Random and Tensorized Sum-Product Networks on mammography images using
patch-wise processing and observe superior performance over utilizing the
models standalone and state-of-the-art in anomaly detection for medical data.
