Paper commentary
Unsupervised Anomaly Detection with Generative Adversarial Networks to Guide Marker Discovery
Unsupervised GAN anomaly detection flags candidate imaging markers from healthy scans
- Problem Finding imaging markers needs many annotated examples of known lesions, so detection stays limited to markers someone has already defined. Many diseases lack such a set.
- Method AnoGAN trains a DCGAN only on healthy OCT patches. For each query patch, it searches a latent code and scores fit with a residual and a feature-based discrimination term.
- Results AnoGAN reached an AUC of 0.89 for image-level detection, compared with 0.88 for GANR and 0.73 for aCAE.
Why known-marker detection falls short
Supervised detection of imaging markers needs many annotated examples of each known lesion type. Its output is therefore confined to the markers that someone has already defined. Many diseases lack a broad enough set of known markers, and even where markers exist, their predictive power can be limited. Richer information in the images then goes unused.
The study turns the problem around: a model is trained only on healthy images, so anything that departs from the learned normal appearance becomes a candidate marker. No labels of pathology enter training. The question is whether such a model, built from healthy OCT patches alone, produces a score that separates pathological patches from normal ones.
Learning healthy anatomy with a DCGAN
A generator maps low-dimensional noise vectors z to images, and a discriminator outputs a single scalar that is read as the probability that its input is a real training image. The two are optimized against each other in a minimax game with the value function written as follows. \[ \min_G \max_D V(D,G) = E_{x\sim p_{data}(x)}[\log D(x)] + E_{z\sim p_z(z)}[\log(1-D(G(z)))] \] The discriminator is pushed to label real patches as real and generated ones as fake, while the generator is trained to fool it.
The generator's objective is written in a form that is equivalent to maximizing the discriminator's output on generated samples.
Training uses 1,000,000 patches of 64×64 pixels, sampled at random positions from flattened retinal areas of 270 clinical OCT volumes of healthy subjects that contain no fluid regions. Each volume has 49 B-scans. Before patch extraction, gray values are normalized to the range from -1 to 1, the volumes are resized in the x-direction, and the retina is flattened using an automatic layer segmentation.
The architecture follows a DCGAN design that was reported to train stably at 64×64 pixels. The generator has four fractionally-strided convolution layers and the discriminator has four convolution layers, all with 5×5 filters. Because the images are gray-scale, the channel counts are 512, 256, 128 and 64 rather than the 1024 to 128 of the original design.
The DCGAN is trained for 20 epochs with Adam.
Mapping a query patch onto the learned manifold
A trained GAN maps latent codes to images but offers no inverse. For a query patch, the search starts from a random latent code, generates an image from it, and then updates the code by backpropagation through the frozen generator and discriminator. The number of update steps is fixed at 500 for each new image.
The residual loss measures pixel-wise dissimilarity between the query and the generated image as a sum of absolute differences, written as follows. \[ L_R(z_\gamma) = \sum |x - G(z_\gamma)| \] If the model is perfect and the query is a normal image, the two images should coincide and this loss should be zero.
The discrimination loss departs from the earlier inpainting formulation, which fed the generated image into the discriminator and used the cross-entropy of its scalar output. Here the loss compares intermediate feature maps of the discriminator instead, an idea taken from feature matching. \[ L_D(z_\gamma) = \sum |f(x) - f(G(z_\gamma))| \] In this form, f denotes the output of an intermediate layer of the discriminator.
The discriminator thus acts as a feature extractor rather than as a classifier in this step.
The two losses are combined as a weighted sum, with λ setting the weight of the discrimination term. \[ L(z_\gamma) = (1-\lambda)\cdot L_R(z_\gamma) + \lambda\cdot L_D(z_\gamma) \] The value λ = 0.1 was chosen empirically from preliminary experiments on a face detection dataset, not on the OCT data.
Turning the mapping into an anomaly score
The anomaly score uses the same two components as the mapping loss, evaluated at the final iterate Γ of the search. \[ A(x) = (1-\lambda)\cdot R(x) + \lambda\cdot D(x) \] Here R(x) is the residual loss and D(x) is the discrimination loss at that last iterate. The same λ that weights the mapping loss weights the score.
A large score means the query is poorly represented by the generator, while a small score means a very similar image was already seen in training. The residual image, the pixel-wise absolute difference between the query and its reconstruction at the final iterate, localizes the regions that drive the anomaly.
For comparison, a reference score is defined with the same residual term and the discrimination loss of the earlier inpainting formulation, which is the reference score used in that prior work.
Image-level detection against two baselines
The evaluation set has 10 healthy and 10 pathological cases from clinical SD-OCT scans, with 8192 test patches that come from cases not used in training. A patch counts as positive if it contains at least one pixel annotated as retinal fluid. The annotations are used only for scoring and were never given to the network.
Performance is reported as ROC curves and their AUC, and the operating point is taken at the cut-off given by Youden's index. AnoGAN reached an AUC of 0.89, GANR 0.88, and aCAE 0.73. At its Youden's index cut-off, AnoGAN had a sensitivity of 0.7279 and a specificity of 0.8928. Using the discriminator output directly, without the latent mapping, gave an AUC of 0.72 and a sensitivity of 0.5124.
By AUC computed on the anomaly score, AnoGAN and GANR show comparable results. The authors attribute this to the good performance of the residual score. The authors attribute the weaker aCAE result to over-adaptation on anomalous images. The aCAE avoids the iterative mapping, which the authors note is an advantage at test time.
The discrimination score D(x) performed better than the reference discrimination score in the ROC comparison. The authors take this as evidence that the proposed discrimination loss is preferable to the reference loss.
Pixel-level and feature-space evidence
For normal patches, the generated image resembles the query. For anomalous patches, the input and generated images differ in intensity or texture, which is what the residual overlay marks. A t-SNE embedding of normal and anomalous images on the last convolution layer of the discriminator is offered as evidence that the discriminator's features separate the two groups.
The pixel-level overlays are described as showing high accuracy against the retinal fluid annotations. The text gives no pixel-level score, so this is a visual, qualitative assessment. In the last column, the model also marks hyperreflective foci, which are lesions beyond the annotated fluid. Both the residual score and the discrimination score flag every example image of diseased test cases as anomalous.
Limitations
The image-level comparison rests on 10 healthy and 10 pathological cases, and the pixel-level evaluation is qualitative. Quantitative scoring uses only the fluid annotations. Hyperreflective foci appear only in the qualitative example, so no measured detection rate is given for them. The λ value was tuned on a face detection dataset rather than on OCT data, and the anomaly score keeps the same λ.
The text reports that the trained model has never seen the lesion types it detects, but whether it finds novel anomalies beyond these lesion types was not tested here.
Paper info
- Authors
- Thomas Schlegl, Philipp Seeböck, Sebastian M. Waldstein, Ursula Schmidt-Erfurth, Georg Langs
- Venue
- arXiv · Preprint
- First published
- 2017-3-17
- Added
- 2026-11-12
- Updated
- 2017-3-17
- Version
- v1
- arXiv
- 1703.05921
- Category
- cs.CV · cs.LG
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Thomas Schlegl, Philipp Seeböck, Sebastian M. Waldstein, Ursula Schmidt-Erfurth, Georg Langs (2017). Unsupervised Anomaly Detection with Generative Adversarial Networks to Guide Marker Discovery. arXiv:1703.05921v1. https://arxiv.org/abs/1703.05921v1
BibTeX
@misc{schlegl2017unsupervised,
title = {{Unsupervised Anomaly Detection with Generative Adversarial Networks to Guide Marker Discovery}},
author = {Thomas Schlegl and Philipp Seeböck and Sebastian M. Waldstein and Ursula Schmidt-Erfurth and Georg Langs},
year = {2017},
eprint = {1703.05921},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1703.05921v1}
}