Manuscript Offprint

arXiv:2610.09670

Quasi-Binarized Autoencoders: An Architecture-Independent Information Bottleneck for Medical Image Anomaly Detection

Shouhei Hanaoka, Takahiro Nakao, Atsushi Takamatsu, Takeharu Yoshikawa, Osamu Abe

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Unsupervised anomaly detection, which learns only from normal images, is a central task in medical image analysis and remains an open problem. Reconstruction-based methods pass an image through an encoder–decoder network trained on normal data and detect anomalies from the residual between the image and its reconstruction. This works only if the information passed from the encoder to the decoder is limited; otherwise the network learns an identity mapping and reconstructs anomalies too. This limit is usually imposed through architectural choices, tuned per dataset, that cannot be stated in bits. We introduce the quasi-binarizing (QB) layer, which squashes each latent element into [0, 1] and adds Laplace noise of scale 1/ε1/\varepsilon. Each element is then ε\varepsilon-locally differentially private, and the mutual information between an image and its reconstruction is bounded by a quantity that depends only on ε\varepsilon and the number of QB elements, whatever the encoder and decoder. Placing a QB layer on every encoder–decoder path, including all skip connections, we build QBAE, a seven-level attention U-Net with 32,768 QB elements. On the seven datasets of the MedIAnomaly benchmark, QBAE with one architecture and one configuration reaches a mean image-level AUROC of 0.828, the highest among methods that do not adapt to each dataset, and the best reported results on BraTS2021 (AUROC 0.911, pixel-level AP 0.838). The noise is kept at test time, so that every reconstruction satisfies the bound. Without input corruption, the bottleneck alone prevents identity collapse (mean AUROC 0.805 vs. 0.590). Code is available at https://github.com/hanaokalog/MedIAnomalyQB.

Keywords: anomaly detection, autoencoder, information bottleneck, differential privacy, medical imaging

1. Introduction

Unsupervised anomaly detection aims to flag images that deviate from a model of normal anatomy, using only normal training data. This setting fits medical imaging well. Normal studies are plentiful, abnormal ones are diverse and costly to annotate, and the full range of pathologies can never be listed in advance. Many paradigms have been proposed,

∗^{*}Corresponding author.

Email address: hanaokalog@gmail.com (Shouhei Hanaoka) including image reconstruction, self-supervised pretext tasks, and feature embedding. Yet the recent MedIAnomaly benchmark (Cai et al., 2025) showed that reconstruction-based autoencoders (AEs) remain among the most competitive and versatile approaches across seven datasets and five imaging modalities. They are especially strong for pixel-level localization, where feature-embedding methods built on natural-image backbones struggle.

An AE detects anomalies only if it reconstructs normal images well and abnormal images poorly. This works only when the information that passes from the encoder to the decoder is limited. Otherwise the network learns a near-identity mapping and reconstructs lesions as faithfully as normal tissue (Cai et al., 2024). In practice this limit is imposed through the architecture. Designers shrink the latent dimension, remove skip connections, or reduce depth, and then tune these choices per dataset. This practice has two drawbacks.

• Expressiveness and information limit are coupled. Components that make reconstructions sharper, such as U-Net skip connections (Ronneberger et al., 2015), attention, and modern up/down-sampling blocks (Chen et al., 2025), also widen the path through which identity can leak. Anomaly-detection AEs therefore stay deliberately small and shallow, while the rest of deep learning has moved on.

  • The limit is not measured. A real-valued latent vector of any dimension can in principle carry unbounded information. The latent dimension is only an indirect proxy, and the amount of information an AE actually transmits can neither be stated in bits nor compared across architectures.

Existing remedies address these issues only in part.

• Variational AEs (Kingma and Welling, 2014) quantify information through a KL term, but they tie the bottleneck to a prior and tend to produce blurry reconstructions.

• Memory-augmented (Gong et al., 2019) and vector-quantized (van den Oord et al., 2017) AEs restrict the latent to a learned codebook. However, the codebook size is again an architectural choice, and skip connections bypass it.

• Denoising AEs (Vincent et al., 2008; Kascenas et al., 2022) take a complementary route. They corrupt the input so that the network must learn to map corrupted images back onto the normal manifold. This yields the strongest image-level results on brain MRI in MedIAnomaly. Yet input corruption shapes what the network learns, not how much information it can transmit.

We propose to separate the information bottleneck from the architecture. We introduce the quasi-binarizing (QB) layer. A QB layer squashes each element of the latent tensor into [0, 1] with a sigmoid and adds Laplace noise of scale 1/ε1/\varepsilon. To remain readable despite this noise, the outputs are driven toward 0 or 1 during training, so that the layer acts as a soft, noisy binarizer; hence its name (Section 3.2.1). The construction comes from differential privacy (DP), a framework for releasing the output of a computation while provably limiting what that output reveals about its input (Dwork et al., 2006). In DP terms, each element has sensitivity one, i.e. its value can change by at most one whatever the input (a property of the function, unrelated to the sensitivity of a diagnostic test), and adding Laplace noise of scale 1/ε1/\varepsilon is exactly the Laplace mechanism. Every element is therefore ε\varepsilon-locally differentially private (Duchi et al., 2013). This yields two bounds on the information an element carries about the input image.

• Privacy bound. The mutual information is at most min⁡{ε,ε2}\min\{\varepsilon, \varepsilon^2\} nats (Cuff and Yu, 2016).

• Amplitude bound. Because each element is confined to [0,1][0, 1], the mutual information is also at most 12ln⁡(2πe(14+2/ε2))−ln⁡(2e/ε)\frac{1}{2} \ln(2\pi e(\frac{1}{4} + 2/\varepsilon^2)) - \ln(2e/\varepsilon) nats (Cover and Thomas, 2006). This bound grows only logarithmically in ε\varepsilon, for example to about 2 bits per element at ε=10\varepsilon = 10.

The noise is drawn independently for each element. The information the decoder receives is therefore bounded by the sum of these per-element bounds, whatever the depth, width, or connectivity of the encoder and decoder. We place a QB layer on every path from the encoder to the decoder, including all skip connections. The resulting budget depends only on ε\varepsilon and the number of QB elements. We keep the noise at test time, so that every reconstruction used for detection is obtained under this budget, and the bottleneck can be stated, and audited, in bits.

Once the information limit no longer depends on the architecture, the encoder and decoder can be made as expressive as reconstruction quality requires. Our Quasi-Binarized Autoencoder (QBAE) is a seven-level U-Net with full-resolution skip connections. It uses DC-AE residual autoencoding blocks (Chen et al., 2025), cross-attention gates that mix each skip with the upsampled path, and attention blocks in the decoder. Every skip connection passes through a QB layer, with the number of QB elements halved at each level, and a fully connected layer at the 2×22 \times 2 bottom feeds a final QB layer. In total, 32,768 QB elements feed the decoder. Classical design rules would call this latent far too large for anomaly detection. Under the QB bottleneck it is not: at ε=10\varepsilon = 10, these elements carry at most 6.5×1046.5 \times 10^4 bits, half the 131,072 bits of a raw 8-bit 128×128128 \times 128 input image.

Because the budget is set by ε\varepsilon alone, one fixed network can be adapted to datasets with very different anomalies by changing a single scalar with a direct meaning, the number of bits allowed through, instead of redesigning the latent space or the skip connections.

Our contributions are:

  1. The QB layer. It is a bounded-input Laplace noise layer that gives every encoder-decoder path an information budget controlled by ε\varepsilon, with an ε\varepsilon-LDP guarantee and closed-form bounds on the mutual information per element.

  2. QBAE. It is an anomaly-detection U-Net in which every encoder-decoder path, including all skip connections, passes through a QB layer. This allows modern high-capacity components without identity leakage.

  3. A systematic evaluation on all seven MediAnomaly datasets at 128×128128 \times 128 resolution, with one network and a sweep of ε\varepsilon over almost two orders of magnitude. With a single configuration for all datasets, QBAE reaches the highest mean AUROC (0.828) among methods that do not adapt to each dataset, and an image-level AUROC of 0.911 and a pixel-level AP of 0.838 on BraTS2021, exceeding the best reported results (0.859 and 0.755). We show that the best ε\varepsilon differs systematically between datasets, that performance is insensitive to ε\varepsilon near its optimum, and that without input corruption the QB bottleneck alone prevents the identity collapse of the network.

  4. Open-source code. The implementation, training scripts and configurations are available at https://github.com/hanaokalog/MediAnomalyQB.

References (62)