# Attention U-Net: Learning Where to Look for the Pancreas

Attention gates let U-Net focus on the pancreas without cascaded models

Ozan Oktay, Jo Schlemper, Loic Le Folgoc, Matthew Lee, Mattias Heinrich, Kazunari Misawa and 6 more · arXiv · 2018-4-11

- **Problem** Pancreas segmentation is hard because the organ has poor contrast and varying shape. Cascaded pipelines fix this with extra models that re-extract similar low-level features, which adds compute and parameters.
- **Method** Attention U-Net places a learned gate on every skip connection. Each gate reads a coarser-scale signal and suppresses irrelevant features before they reach the decoder.
- **Results** Attention U-Net reached a pancreas Dice of 0.840, compared with 0.814 for U-Net, on the CT-150 dataset.

## Why cascaded pancreas pipelines are expensive

Pancreas segmentation is hard because the organ has poor contrast against nearby tissue, and its shape and size differ a lot between patients. Standard FCNs and U-Nets handle much of this, but they still struggle to cut false-positive predictions on small objects whose shape varies. A common workaround is a cascade, where one model finds a region of interest and a second model refines the segmentation inside that crop.

Atlas-based methods scored Dice from 69.6% to 73.9% on the TCIA data, and recent cascaded CNNs reached 81.2% to 82.4%. Dropping the cascade lowered performance by between 2.0% and 4.4%, according to the cited work. The cost goes beyond accuracy, because each stage re-extracts similar low-level features, so compute and parameters grow with every model in the chain.

## Gating the skip connections

The key idea is to place a learned gate on every skip connection of a U-Net, so the gate can suppress irrelevant features before they reach the decoder. Each gate reads a signal taken from a coarser scale, which carries context about where the target organ probably lies. The authors expected this to work because the coarse context helps separate useful fine-scale responses from noisy ones in the skip features.

In the default setting, one scalar coefficient per pixel scales every channel of that pixel's feature vector. The gate runs right before concatenation, so only the surviving activations are merged with decoder features. Because the gates sit inside the network, no region of interest is cropped and no second network is run.

The gating signal used in earlier attention work for natural images was a single global vector for the whole image. Here the gating signal is a spatial grid, so the attention coefficients can be specific to local regions. Each skip connection's gating signal also combines several imaging scales, which raises the grid resolution of the query.

Because the design avoids adaptive pooling, it can still produce dense predictions.

## What one gate computes and how it is trained

The gate projects the skip features and the gating signal with 1x1x1 convolutions, adds the two projections, and applies a ReLU. In the paper's notation, \\(q^l\_{att} = \\psi^T(\\sigma\_1(W\_x^T x\_i^l + W\_g^T g\_i + b\_g)) + b\_\\psi\\) and \\(\\alpha\_i^l = \\sigma\_2(q^l\_{att})\\).

The authors chose a sigmoid over softmax, noting that softmax gives sparser activations at the output. They report that the sigmoid gave better convergence for the gate parameters. The gate parameters train with ordinary back-propagation, so no sampling-based update is needed as in hard attention.

The gate also changes the backward pass, because gradients from background regions are down-weighted before they reach shallower layers. The update for shallower kernels has a first term scaled by the coefficient, plus a term that flows through the coefficient itself. Gates start by passing features at every location, and the models are trained with Adam, the Sorensen-Dice loss and deep supervision.

## Datasets and training setup

Two CT abdominal datasets were used, CT-150 and CT-82. CT-82 is the public NIH-TCIA set of 82 contrast-enhanced scans with slice-by-slice pancreas annotation. Both datasets were resampled to 2.00 mm isotropic resolution because of image size and memory limits.

The models are 3D and use batches of 2 to 4 samples, with gradient averaging over several passes for larger networks. Training uses the Adam optimiser, batch normalisation, deep supervision and standard augmentation such as affine transforms, axial flips and random crops. The authors compare the gated model with a standard 3D U-Net on segmentation, capacity, computation time and memory.

## Pancreas gains on CT-150

With 120 training and 30 test scans, Attention U-Net scored a pancreas Dice of 0.840, compared to 0.814 for U-Net. Recall rose from 0.806 to 0.841, and the authors report p = .005 for the recall gain. The authors read this as the gates helping the model find pancreas pixels it would otherwise miss.

With only 30 training scans and 120 test scans, pancreas Dice was 0.741 for U-Net and 0.767 for Attention U-Net. The authors say the improvement holds across both training sizes, with p = .01. Both models lose accuracy when training data shrink, and the gated model's spleen Dice drops less.

Kidney scores were close in both splits, which the authors link to higher tissue contrast in the kidney. So the clearest gain is on the small, low-contrast pancreas, while organs with stronger contrast change little.

## Is the gain just extra capacity?

To check this, the authors trained higher-capacity U-Nets with the extra filters spread across all layers.

The authors conclude that adding gates helps more than uniform extra capacity, with p = .007. They suggest extra capacity is better spent on gates that localise tissue than on more filters everywhere. This capacity check covers only the 120/30 split of CT-150.

## Transfer to CT-82 and cross-validation

Before any fine-tuning, models trained on CT-150 were applied directly to CT-82, where Attention U-Net scored 0.712 and U-Net scored 0.690. The authors say U-Net beats the atlas method cited as \[34\], but the atlas range quoted in related work starts at 69.6%, above the 0.690 they report. So this atlas comparison isn't settled by these numbers.

After fine-tuning on 61 training and 21 test scans, Attention U-Net scored 0.831 and U-Net scored 0.820. During fine-tuning the spleen and kidney outputs were excluded, and gradients came only from background and pancreas labels. Trained from scratch on 61 randomly chosen scans, the two models scored 0.821 and 0.815. The authors report lower surface distances (p = .03) and link them to higher pancreas recall, but that recall difference has p = .09.

In 5-fold cross-validation on CT-82, Attention U-Net without post-processing reached 81.48 ± 6.23 pancreas Dice. Table 4 lists published CT-82 pancreas results, but those used different training splits and fold counts, so they aren't a controlled comparison. The authors say their approach performs similarly to published work despite lower input resolution.

## What the gates learn during training

Figure 4 shows attention coefficients on a test CT volume at epochs 3, 6, 10, 60 and 150. Early on, the coefficients are close to uniform, so features pass at all locations. Over training they concentrate on the pancreas, kidney and spleen boundaries.

Coarser gates give rough organ outlines, and finer gates refine them. With several gates at each scale, each gate tends to attend to a different subset of organs. This is a qualitative observation from visualisations, not a measured metric.

## Limitations

No post-processing such as a conditional random field was used, so the scores show the gates' effect in an isolated setting. Inputs were resampled to 2.00 mm because of memory limits, and the authors leave finer-resolution input for future work. Residual connections around the gate did not give a significant gain in the authors' experiments.

The experiments cover two CT abdominal datasets and their labels, and no other organs or imaging modalities were tested.

## Paper info

- **Authors**: Ozan Oktay, Jo Schlemper, Loic Le Folgoc, Matthew Lee, Mattias Heinrich, Kazunari Misawa, Kensaku Mori, Steven McDonagh, Nils Y Hammerla, Bernhard Kainz, Ben Glocker, Daniel Rueckert
- **Venue**: arXiv · Preprint
- **First published**: 2018-4-11
- **Added**: 2026-11-11
- **Updated**: 2018-5-20
- **Version**: v3
- **arXiv**: 1804.03999
- **Category**: cs.CV
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1804.03999v3) · [PDF ↗](https://arxiv.org/pdf/1804.03999v3)

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

Ozan Oktay, Jo Schlemper, Loic Le Folgoc, Matthew Lee, Mattias Heinrich, Kazunari Misawa, Kensaku Mori, Steven McDonagh, Nils Y Hammerla, Bernhard Kainz, Ben Glocker, Daniel Rueckert (2018). Attention U-Net: Learning Where to Look for the Pancreas. arXiv:1804.03999v3. https://arxiv.org/abs/1804.03999v3

**BibTeX**

```
@misc{oktay2018attention,
  title = {{Attention U-Net: Learning Where to Look for the Pancreas}},
  author = {Ozan Oktay and Jo Schlemper and Loic Le Folgoc and Matthew Lee and Mattias Heinrich and Kazunari Misawa and Kensaku Mori and Steven McDonagh and Nils Y Hammerla and Bernhard Kainz and Ben Glocker and Daniel Rueckert},
  year = {2018},
  eprint = {1804.03999},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1804.03999v3}
}
```

## Other paper commentary

- [node2vec: Scalable Feature Learning for Networks](https://refivu.com/en/papers/dc0725e4-ec21-4d60-9363-0eac2fc69a10-node2vec-scalable-feature-learning-for-networks.md)
- [Explainable Artificial Intelligence (XAI): Concepts, Taxonomies, Opportunities and Challenges toward Responsible AI](https://refivu.com/en/papers/3f686a20-03db-4642-80bb-f85fafc1d04f-explainable-artificial-intelligence-xai-concepts-taxonomies.md)
- [Intriguing properties of neural networks](https://refivu.com/en/papers/5d9b1ffd-1b1d-4795-87df-32680ad74683-intriguing-properties-of-neural-networks.md)
- [Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling](https://refivu.com/en/papers/136a3b1f-3eb6-469b-8a8a-7536056851d5-empirical-evaluation-of-gated-recurrent-neural-networks-on.md)
- [Convolutional Neural Networks for Sentence Classification](https://refivu.com/en/papers/e03eeb97-8544-4ef6-a8e6-47276e072373-convolutional-neural-networks-for-sentence-classification.md)
- [Deep Learning in Neural Networks: An Overview](https://refivu.com/en/papers/fc7c2f1e-9030-4a55-892b-82a89ff398b7-deep-learning-in-neural-networks-an-overview.md)
- [Learning Spatiotemporal Features with 3D Convolutional Networks](https://refivu.com/en/papers/ea19793d-36a8-4fd0-8e8c-f8d836d8146c-learning-spatiotemporal-features-with-3d-convolutional.md)
- [PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space](https://refivu.com/en/papers/34b11e2b-6f2e-4cbb-88e2-1045aeb46f06-pointnet-deep-hierarchical-feature-learning-on-point-sets.md)
- [Image Super-Resolution Using Deep Convolutional Networks](https://refivu.com/en/papers/cb0f63f2-2b9c-40a6-9d74-55cfce2a1ea6-image-super-resolution-using-deep-convolutional-networks.md)
- [ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices](https://refivu.com/en/papers/5e319185-7793-46fa-a04c-1eefe3a80e23-shufflenet-an-extremely-efficient-convolutional-neural.md)
- [Path Aggregation Network for Instance Segmentation](https://refivu.com/en/papers/a3658986-d50d-4da4-997a-1b69d8a09d76-path-aggregation-network-for-instance-segmentation.md)
- [EfficientDet: Scalable and Efficient Object Detection](https://refivu.com/en/papers/bea70d85-5dca-48dc-8e51-707923164b9b-efficientdet-scalable-and-efficient-object-detection.md)

## Terms in this paper

- [u-net](https://refivu.com/en/terms/f49a93d54ad5-u-net)
- [recall](https://refivu.com/en/terms/3774987267f3-recall)
- [deep supervision](https://refivu.com/en/terms/5fe4f2985157-deep-supervision)
- [FCN](https://refivu.com/en/terms/a92993ff7ed6-fcn)
- [attention](https://refivu.com/en/terms/99bae6e0dde0-attention)
- [deep-supervision](https://refivu.com/en/terms/60ce9d12f385-deep-supervision)
- [Dice score](https://refivu.com/en/terms/7aa00c9618bb-dice-score)
- [ADAM optimiser](https://refivu.com/en/terms/d5b689d687fb-adam-optimiser)
- [additive attention](https://refivu.com/en/terms/dc1effe7dceb-additive-attention)
- [attention gate](https://refivu.com/en/terms/8ad827a9cb9b-attention-gate)
- [Attention U-Net](https://refivu.com/en/terms/23663a490bf3-attention-u-net)
- [gating signal](https://refivu.com/en/terms/bb4b1c6c629b-gating-signal)
- [skip connection](https://refivu.com/en/terms/29eee6490e99-skip-connection)
- [Sorensen-Dice loss](https://refivu.com/en/terms/a2d9de210d75-sorensen-dice-loss)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/b480e08e-027d-4c11-b1c5-0d3a4a63ead9-attention-u-net-learning-where-to-look-for)
