U-Net: Convolutional Networks for Biomedical
Image Segmentation
U-Net: 生体医学画像セグメンテーションのための畳み込みネットワーク
Olaf Ronneberger, Philipp Fischer, and Thomas Brox
Computer Science Department and BIOSS Centre for Biological Signalling Studies,
University of Freiburg, Germany
ronneber@informatik.uni-freiburg.de,
WWW home page: http://lmb.informatik.uni-freiburg.de/
Olaf Ronneberger, Philipp Fischer, Thomas Brox
ドイツ、フライブルク大学
コンピュータサイエンス学部およびBIOSS生物シグナル研究センター
ronneber@informatik.uni-freiburg.de
WWWホームページ: http://lmb.informatik.uni-freiburg.de/
Abstract. There is large consent that successful training of deep networks requires many thousand annotated training samples. In this paper, we present a network and training strategy that relies on the strong use of data augmentation to use the available annotated samples more efficiently. The architecture consists of a contracting path to capture context and a symmetric expanding path that enables precise localization. We show that such a network can be trained end-to-end from very few images and outperforms the prior best method (a sliding-window convolutional network) on the ISBI challenge for segmentation of neuronal structures in electron microscopic stacks. Using the same network trained on transmitted light microscopy images (phase contrast and DIC) we won the ISBI cell tracking challenge 2015 in these categories by a large margin. Moreover, the network is fast. Segmentation of a 512x512 image takes less than a second on a recent GPU. The full implementation (based on Caffe) and the trained networks are available at http://lmb.informatik.uni-freiburg.de/people/ronneber/u-net.
抄録. 深層ネットワークの成功した学習には、多数のアノテーション付きトレーニングサンプルが必要であるという点で大きな合意がある。本論文では、データ拡張を強力に活用し、利用可能なアノテーション付きサンプルをより効率的に使用するためのネットワークと学習戦略を提示する。アーキテクチャは、コンテキストを捉えるための収縮パスと、正確な局所化を可能にする対称的な拡張パスから構成される。我々は、そのようなネットワークが非常に少ない画像数からエンドツーエンドで訓練可能であり、電子顕微鏡スタックにおける神経構造のセグメンテーションに関するISBIチャレンジにおいて、従来最良の方法(スライディングウィンドウ畳み込みネットワーク)を上回る性能を示すことを示す。透過光顕微鏡画像(位相差およびDIC)で訓練された同じネットワークを用い、これらのカテゴリにおいてISBI細胞追跡チャレンジ2015で大幅な差をつけて優勝した。さらに、このネットワークは高速である。512x512画像のセグメンテーションは、最新のGPU上で1秒未満で完了する。完全な実装(Caffeベース)および訓練済みネットワークは http://lmb.informatik.uni-freiburg.de/people/ronneber/u-net で入手可能である。
1 Introduction
1 序論
In the last two years, deep convolutional networks have outperformed the state of the art in many visual recognition tasks, e.g. [7,3]. While convolutional networks have already existed for a long time [8], their success was limited due to the size of the available training sets and the size of the considered networks. The breakthrough by Krizhevsky et al. [7] was due to supervised training of a large network with 8 layers and millions of parameters on the ImageNet dataset with 1 million training images. Since then, even larger and deeper networks have been trained [12].
The typical use of convolutional networks is on classification tasks, where the output to an image is a single class label. However, in many visual tasks, especially in biomedical image processing, the desired output should include localization, i.e., a class label is supposed to be assigned to each pixel. Moreover, thousands of training images are usually beyond reach in biomedical tasks. Hence, Ciresan et al. [1] trained a network in a sliding-window setup to predict the class label of each pixel by providing a local region (patch) around that pixel
過去2年間で、深層畳み込みニューラルネットワークは、画像認識の多くのタスクにおいて最先端の性能を超えており、例えば[7,3]。畳み込みニューラルネットワークはすでに長く存在していたが[8]、利用可能な学習データセットの規模や対象となるネットワークの規模のため、その成功は限定的であった。Krizhevskyらによる画期的な成果[7]は、100万枚の学習画像を持つImageNetデータセット上で、8層の数百万パラメータを持つ大規模ネットワークを教師あり学習させたことによるものである。それ以降、さらに大規模で深いネットワークが訓練されてきた[12]。
畳み込みニューラルネットワークの典型的な用途は分類タスクであり、画像に対する出力は単一のクラスラベルである。しかし、多くの視覚タスク、特に生体医学画像処理では、望ましい出力には局在化(ローカライゼーション)が含まれ、つまり各ピクセルにクラスラベルを割り当てるべきである。さらに、生体医学タスクでは通常、数千枚の学習画像を用意することは現実的ではない。そのため、Ciresanらは[1]、スライディングウィンドウ方式でネットワークを訓練し、各ピクセルの周囲の局所領域(パッチ)を提供することで、各ピクセルのクラスラベルを予測した。
arXiv:1505.04597v1 [cs.CV] 18 May 2015
arXiv:1505.04597v1 [cs.CV] 2015年5月18日
<img src="https://www.kolmopdf.com/images/sk-72e2d70ad175490c80c14b553bdd1e3a/575/2-1.png" style="zoom:70%; display: block; margin: 0 auto;" />
Fig. 1. U-net architecture (example for 32x32 pixels in the lowest resolution). Each blue box corresponds to a multi-channel feature map. The number of channels is denoted on top of the box. The x-y-size is provided at the lower left edge of the box. White boxes represent copied feature maps. The arrows denote the different operations.
図1. U-netアーキテクチャ(最低解像度における32x32ピクセルの例)。各青いボックスはマルチチャンネル特徴マップに対応します。チャンネル数はボックスの上に示されています。x-yサイズはボックスの左下隅に記載されています。白いボックスはコピーされた特徴マップを表します。矢印は異なる操作を示しています。
as input. First, this network can localize. Secondly, the training data in terms of patches is much larger than the number of training images. The resulting network won the EM segmentation challenge at ISBI 2012 by a large margin.
Obviously, the strategy in Ciresan et al. [1] has two drawbacks. First, it is quite slow because the network must be run separately for each patch, and there is a lot of redundancy due to overlapping patches. Secondly, there is a trade-off between localization accuracy and the use of context. Larger patches require more max-pooling layers that reduce the localization accuracy, while small patches allow the network to see only little context. More recent approaches [11,4] proposed a classifier output that takes into account the features from multiple layers. Good localization and the use of context are possible at the same time.
In this paper, we build upon a more elegant architecture, the so-called “fully convolutional network” [9]. We modify and extend this architecture such that it works with very few training images and yields more precise segmentations; see Figure 1. The main idea in [9] is to supplement a usual contracting network by successive layers, where pooling operators are replaced by upsampling operators. Hence, these layers increase the resolution of the output. In order to localize, high resolution features from the contracting path are combined with the upsampled
入力として用いる。まず、このネットワークは局所化が可能である。第二に、パッチに関する訓練データ量は、訓練画像の数よりもはるかに大きい。その結果得られたネットワークは、ISBI 2012のEMセグメンテーションチャレンジで大きな差をつけて優勝した。
明らかに、Ciresan et al. [1] の戦略には2つの欠点がある。第一に、各パッチに対してネットワークを個別に実行する必要があり、また重複するパッチによる冗長性が大きいため、非常に遅い。第二に、局所化精度と文脈の利用の間にはトレードオフが存在する。大きなパッチではより多くのマックスプーリング層が必要となり、局所化精度が低下する。一方、小さなパッチではネットワークが見られる文脈が限られる。より最近のアプローチ [11,4] では、複数のレイヤーからの特徴を考慮した分類器出力が提案された。これにより、高精度な局所化と文脈の利用を同時に実現可能となった。
本論文では、より洗練されたアーキテクチャである「全畳み込みネットワーク」[9] を基盤として構築する。我々は、このアーキテクチャを修正・拡張し、極めて少ない訓練画像数で動作し、より精密なセグメンテーションを実現するようにした(図1参照)。[9] の主なアイデアは、通常の縮約ネットワークに連続的なレイヤーを追加し、プーリング演算子をアップサンプリング演算子に置き換えることである。したがって、これらのレイヤーは出力の解像度を高める。局所化のため、縮約パスからの高解像度特徴量とアップサンプリングされた
<img src="https://www.kolmopdf.com/images/sk-72e2d70ad175490c80c14b553bdd1e3a/575/3-1.png" style="zoom:70%; display: block; margin: 0 auto;" />
Fig. 2. Overlap-tile strategy for seamless segmentation of arbitrary large images (here segmentation of neuronal structures in EM stacks). Prediction of the segmentation in the yellow area, requires image data within the blue area as input. Missing input data is extrapolated by mirroring
図2. 任意の大きな画像のシームレスなセグメンテーションのためのオーバーラップタイル戦略(ここではEMスタック内の神経構造のセグメンテーション)。黄色領域におけるセグメンテーションの予測には、青領域の画像データが入力として必要です。不足している入力データは、鏡像処理によって外挿されます。
output. A successive convolution layer can then learn to assemble a more precise output based on this information. One important modification in our architecture is that in the upsampling part we have also a large number of feature channels, which allow the network to propagate context information to higher resolution layers. As a consequence, the expansive path is more or less symmetric to the contracting path, and yields a u-shaped architecture. The network does not have any fully connected layers and only uses the valid part of each convolution, i.e., the segmentation map only contains the pixels, for which the full context is available in the input image. This strategy allows the seamless segmentation of arbitrarily large images by an overlap-tile strategy (see Figure 2). To predict the pixels in the border region of the image, the missing context is extrapolated by mirroring the input image. This tiling strategy is important to apply the network to large images, since otherwise the resolution would be limited by the GPU memory. As for our tasks there is very little training data available, we use excessive data augmentation by applying elastic deformations to the available training images. This allows the network to learn invariance to such deformations, without the need to see these transformations in the annotated image corpus. This is particularly important in biomedical segmentation, since deformation used to be the most common variation in tissue and realistic deformations can be simulated efficiently. The value of data augmentation for learning invariance has been shown in Dosovitskiy et al. [2] in the scope of unsupervised feature learning. Another challenge in many cell segmentation tasks is the separation of touching objects of the same class; see Figure 3. To this end, we propose the use of a weighted loss, where the separating background labels between touching cells obtain a large weight in the loss function. The resulting network is applicable to various biomedical segmentation problems. In this paper, we show results on the segmentation of neuronal structures in EM stacks (an ongoing competition started at ISBI 2012), where we out-
出力。その後、連続する畳み込み層は、この情報に基づいてより精密な出力を組み立てることを学習できる。本アーキテクチャにおける重要な変更点は、アップサンプリング部分でも多数の特征チャネルを有しており、これによりネットワークがコンテキスト情報をより高解像度の層へ伝播させることができる点である。その結果、拡張パスは縮小パスとほぼ対称となり、U字型のアーキテクチャが得られる。ネットワークには全結合層がなく、各畳み込みの有効部分のみを使用するため、セグメンテーションマップには入力画像内で完全なコンテキストが利用可能な画素のみが含まれる。この戦略により、オーバーラップタイル戦略を用いて任意に大きな画像のシームレスなセグメンテーションが可能となる(図2参照)。画像の境界領域にある画素を予測するために、不足しているコンテキストは入力画像を鏡像化することで外挿される。このタイル戦略は、GPUメモリによって解像度が制限されない限り、ネットワークを大画像に適用する上で重要である。本研究のタスクでは訓練データが非常に少ないため、利用可能な訓練画像に対して弾性変形を適用することによる過剰なデータ水増しを行う。これにより、ネットワークは注釈付き画像コーパスでこれらの変換を見る必要なく、このような変形に対する不変性を学習できる。これは生体医学的セグメンテーションにおいて特に重要である。なぜなら、組織における最も一般的な変異は変形で、現実的な変形を効率的にシミュレートできるからである。不変性の学習におけるデータ水増しの有用性は、Dosovitskiyら[2]による教師なし特徴学習の文脈で示されている。多くの細胞セグメンテーションタスクにおけるもう一つの課題は、同じクラスの接しているオブジェクトの分離である(図3参照)。そこで、接している細胞間の背景ラベルに損失関数内で大きな重みを付与する重み付き損失の使用を提案する。得られたネットワークは、さまざまな生体医学的セグメンテーション問題に適用可能である。本論文では、EMスタック内のニューロン構造のセグメンテーション(ISBI 2012で始まった進行中の競技)に関する結果を示す。
performed the network of Ciresan et al. [1]. Furthermore, we show results for cell segmentation in light microscopy images from the ISBI cell tracking challenge 2015. Here we won with a large margin on the two most challenging 2D transmitted light datasets.
Ciresan らのネットワーク [1] を実装した。さらに、ISBI セル追跡チャレンジ 2015 の光顕微鏡画像における細胞セグメンテーションの結果を示す。ここでは、最も困難な 2 つの透過光データセットにおいて大幅な差をつけて優勝した。
2 Network Architecture
2 ネットワークアーキテクチャ
The network architecture is illustrated in Figure 1. It consists of a contracting path (left side) and an expansive path (right side). The contracting path follows the typical architecture of a convolutional network. It consists of the repeated application of two 3x3 convolutions (unpadded convolutions), each followed by a rectified linear unit (ReLU) and a 2x2 max pooling operation with stride 2 for downsampling. At each downsampling step we double the number of feature channels. Every step in the expansive path consists of an upsampling of the feature map followed by a 2x2 convolution (“up-convolution”) that halves the number of feature channels, a concatenation with the correspondingly cropped feature map from the contracting path, and two 3x3 convolutions, each followed by a ReLU. The cropping is necessary due to the loss of border pixels in every convolution. At the final layer a 1x1 convolution is used to map each 64-component feature vector to the desired number of classes. In total the network has 23 convolutional layers.
To allow a seamless tiling of the output segmentation map (see Figure 2), it is important to select the input tile size such that all 2x2 max-pooling operations are applied to a layer with an even x- and y-size.
ネットワークアーキテクチャを図1に示す。これは縮小パス(左側)と拡張パス(右側)から構成される。縮小パスは畳み込みネットワークの典型的なアーキテクチャに従う。これは、2つの3x3畳み込み(パディングなしの畳み込み)を繰り返して適用し、それぞれに整流線形ユニット(ReLU)とストライド2の2x2最大プーリング操作によるダウンサンプリングが続くものとなっている。各ダウンサンプリングステップで、特徴マップのチャンネル数を2倍にする。拡張パスの各ステップは、特徴マップのアップサンプリング、それに続く2x2畳み込み(「アップコンボリューション」)によって特徴マップのチャンネル数を半減させる処理、縮小パスから対応する切り捨てられた特徴マップとの連結、および2つの3x3畳み込み(それぞれにReLUが続く)からなる。この切り捨ては、各畳み込みで境界画素が失われるため必要である。最終層では、1x1畳み込みを用いて、各64成分の特徴ベクトルを目的のクラス数にマッピングする。合計で、ネットワークには23の畳み込み層がある。
出力セグメンテーションマップのシームレスなタイル化を可能にするために(図2参照)、すべての2x2最大プーリング操作が偶数のxサイズおよびyサイズを持つレイヤーに対して適用されるように、入力タイルサイズを選択することが重要である。
3 Training
3 トレーニング
The input images and their corresponding segmentation maps are used to train the network with the stochastic gradient descent implementation of Caffe [6]. Due to the unpadded convolutions, the output image is smaller than the input by a constant border width. To minimize the overhead and make maximum use of the GPU memory, we favor large input tiles over a large batch size and hence reduce the batch to a single image. Accordingly we use a high momentum (0.99) such that a large number of the previously seen training samples determine the update in the current optimization step.
The energy function is computed by a pixel-wise soft-max over the final feature map combined with the cross entropy loss function. The soft-max is defined as pk(x)=exp(ak(x))/(∑k′=1Kexp(ak′(x))) where ak(x) denotes the activation in feature channel k at the pixel position x∈Ω with Ω⊂Z2. K is the number of classes and pk(x) is the approximated maximum-function. I.e. pk(x)≈1 for the k that has the maximum activation ak(x) and pk(x)≈0 for all other k. The cross entropy then penalizes at each position the deviation of pℓ(x)(x) from 1 using
E=x∈Ω∑w(x)log(pℓ(x)(x))(1)
入力画像とそれに対応するセグメンテーションマップは、Caffe [6] の確率的勾配降下実装を用いてネットワークの訓練に使用される。パディングなしの畳み込みにより、出力画像は入力画像よりも一定の境界幅だけ小さくなる。オーバーヘッドを最小限に抑え、GPUメモリの利用を最大化するため、大きなバッチサイズよりも大きな入力タイルを採用し、したがってバッチサイズを1枚の画像に削減する。これに応じて、高いモーメンタム(0.99)を使用し、以前に観測された訓練サンプルの多くが現在の最適化ステップにおける更新を決定するようにする。
エネルギー関数は、最終的な特徴マップに対するピクセルごとのソフトマックスと交差エントロピー損失関数を組み合わせて計算される。ソフトマックスは pk(x)=exp(ak(x))/(∑k′=1Kexp(ak′(x))) と定義され、ここで ak(x) は画素位置 x∈Ω (Ω⊂Z2)における特徴チャネル k の活性化値を示す。K はクラス数であり、pk(x) は最大関数の近似である。つまり、最大の活性化値 ak(x) を持つ k に対して pk(x)≈1 となり、他のすべての k に対して pk(x)≈0 となる。交差エントロピーは、各位置において pℓ(x)(x) が1からどれだけずれているかを以下のようにペナルティとして課す
E=x∈Ω∑w(x)log(pℓ(x)(x))(1)