1 Introduction

Deep learning, in particular, convolutional neural networks (CNN) have become the standard for image classification [1, 2]. Fully convolutional neural networks (F-CNNs) have become the tool of choice for many image segmentation tasks in medical imaging [3,4,5] and computer vision [6,7,8,9]. The basic building block for all these architectures is the convolution layer, which learns filters capturing local spatial pattern along all the input channels and generates feature maps jointly encoding the spatial and channel information. While much effort is put into improving this joint encoding of spatial and channel information, encoding of the spatial and channel-wise patterns independently is less explored. Recent work attempted to address this issue by explicitly modeling the interdependencies between the channels of feature maps. An architectural component called squeeze & excitation (SE) block [10] was introduced, which can be seamlessly integrated within any CNN model. The SE block factors out the spatial dependency by global average pooling to learn a channel specific descriptor, which is used to recalibrate the feature map to emphasize on useful channels. Its nomenclature is motivated by the fact that the SE block ‘squeezes’ along the spatial domain and ‘excites’ or reweights along the channels. A convolutional network with SE blocks won the first place in the ILSVRC 2017 classification competition on the ImageNet dataset, indicating its effectiveness [10].

In this work, we want to leverage the high performance of SE blocks for image classification to image segmentation with F-CNNs. We refer to the previously introduced SE block as channel SE (cSE), because it only excites channel-wise, which proved to be effective for classification. We hypothesize that for image segmentation, the pixel-wise spatial information is more informative. Hence, we introduce another SE block, which ‘squeezes’ along the channels and ‘excites’ spatially, termed spatial SE (sSE). Finally, we propose to have concurrent spatial and channel SE blocks (scSE) that recalibrate the feature maps separately along channel and space, and then combines the output. Encouraging feature maps to be more informative both spatially and channel-wise. To the best of our knowledge, this is the first time that spatial squeeze & excitation is proposed for neural networks and the first integration of squeeze & excitation in F-CNNs.

We integrate the proposed SE blocks (cSE, sSE and scSE) in three state-of-the-art F-CNN models for image segmentation to demonstrate that SE blocks are a generic network component to boost performance. We evaluate the segmentation performance in two important medical applications: whole-brain and whole-body segmentation. In whole-brain segmentation, we automatically identify 27 cortical and subcortical structures on magnetic resonance imaging (MRI) T1-weighted brain scans. In whole-body segmentation, we automatically label 10 visceral organs on contrast-enhanced CT scan of the abdomen.

Related Work: F-CNN architectures have successfully been used in a wide variety of medical image segmentation tasks to provide state-of-the-art performance. A seminal F-CNN model is U-Net [3], which has an encoder/decoder based architecture combined with skip connections between encoder and decoder blocks with similar spatial resolution. SkipDeconv-Net (SD-Net) [4] builds upon U-Net, using unpooling layers used in [7] for decoding, learnt by jointly optimizing logistic and Dice loss functions. A more recent architecture introduces dense connectivity within the encoder and decoder blocks, unlike U-Net and SD-Net which uses normal convolutions, termed fully convolutional DenseNet [9].

2 Methods

Let us assume an input feature map \(\mathbf {X} \in \mathbb {R}^{H \times W \times C'}\) that passes through an encoder or decoder block \(\mathbf {F}_{tr}(\cdot )\) to generate output feature map \(\mathbf {U} \in \mathbb {R}^{H \times W \times C}\), \(\mathbf {F}_{tr}:\mathbf {X}\rightarrow \mathbf {U}\). Here H and W are the spatial height and width, with \(C'\) and C being the input and output channels, respectively. The generated \(\mathbf {U}\) combines the spatial and channel information of \(\mathbf {X}\) through a series of convolutional layers and non-linearities defined by \(\mathbf {F}_{tr}(\cdot )\). We place the SE blocks \(\mathbf {F}_{SE}(\cdot )\) on \(\mathbf {U}\) to recalibrate it to \(\hat{\mathbf {U}}\). We propose three different variants of SE blocks, which are detailed next. The SE blocks can be seamlessly integrated within any F-CNN model by placing them after every encoder and decoder block, as illustrated in Fig. 1(a). \(\hat{\mathbf {U}}\) is used in the subsequent pooling/upsampling layers.

Fig. 1.
figure 1

Illustration of network architecture with squeeze & excitation (SE) blocks. (a) The proposed integration of SE blocks within F-CNN. (b–d) The architectural design of cSE, sSE and scSE blocks, respectively, for recalibrating feature map \(\mathbf {U}\).

2.1 Spatial Squeeze and Channel Excitation Block (cSE)

We describe the spatial squeeze and channel excitation block, which was proposed in [10]. We consider the input feature map \(\mathbf {U} = [\mathbf {u}_1, \mathbf {u}_2, \cdots , \mathbf {u}_{C}]\) as a combination of channels \(\mathbf {u}_i \in \mathbb {R}^{H \times W}\). Spatial squeeze is performed by a global average pooling layer, producing vector \(\mathbf {z} \in \mathbb {R}^{1 \times 1 \times C}\) with its \(k^{th}\) element

$$\begin{aligned} z_k = \frac{1}{H \times W} \sum _i^H \sum _j^W \mathbf {u}_k (i,j). \end{aligned}$$
(1)

This operation embeds the global spatial information in vector \(\mathbf {z}\). This vector is transformed to \(\hat{\mathbf {z}}=\mathbf {W}_1 (\delta (\mathbf {W}_2 \mathbf {z}))\), with \(\mathbf {W}_1 \in \mathbb {R}^{C \times \frac{C}{2}}\), \(\mathbf {W}_2 \in \mathbb {R}^{\frac{C}{2} \times C}\) being weights of two fully-connected layers and the ReLU operator \(\delta (\cdot )\). This encodes the channel-wise dependencies. The dynamic range of the activations of \(\hat{\mathbf {z}}\) are brought to the interval [0, 1], passing it through a sigmoid layer \(\sigma (\hat{\mathbf {z}})\). The resultant vector is used to recalibrate or excite \(\mathbf {U}\) to

$$\begin{aligned} \hat{\mathbf {U}}_{cSE} = F_{cSE}(\mathbf {U}) = [\sigma (\hat{z_1})\mathbf {u}_1, \sigma (\hat{z_2})\mathbf {u}_2, \cdots , \sigma (\hat{z_{C}})\mathbf {u}_{C}]. \end{aligned}$$
(2)

The activation \(\sigma (\hat{z}_i)\) indicates the importance of the \(i^{th}\) channel, which are rescaled. As the network learns, these activations are adaptively tuned to ignore less important channels and emphasize the important ones. The architecture of the block is illustrated in Fig. 1(b).

2.2 Channel Squeeze and Spatial Excitation Block (sSE)

We introduce the channel squeeze and spatial excitation block that squeezes the feature map \(\mathbf {U}\) along the channels and excites spatially, which we consider important for fine-grained image segmentation. Here, we consider an alternative slicing of the input tensor \(\mathbf {U} = [\mathbf {u}^{1,1}, \mathbf {u}^{1,2}, \cdots , \mathbf {u}^{i,j}, \cdots ,\mathbf {u}^{H,W}]\), where \(\mathbf {u}^{i,j} \in \mathbb {R}^{1 \times 1 \times C}\) corresponding to the spatial location (ij) with \(i \in \{1, 2, \cdots , H\}\) and \(j \in \{1, 2, \cdots , W\}\). The spatial squeeze operation is achieved through a convolution \(\mathbf {q} = \mathbf {W}_{sq} \star \mathbf {U}\) with weight \(\mathbf {W}_{sq} \in \mathbb {R}^{1 \times 1 \times C \times 1}\), generating a projection tensor \(\mathbf {q} \in \mathbb {R}^{H \times W}\). Each \(q_{i,j}\) of the projection represents the linearly combined representation for all channels C for a spatial location (ij). This projection is passed through a sigmoid layer \(\sigma (.)\) to rescale activations to [0, 1], which is used to recalibrate or excite \(\mathbf {U}\) spatially

$$\begin{aligned} \hat{\mathbf {U}}_{sSE} = F_{sSE}(\mathbf {U}) = [\sigma (q_{1,1})\mathbf {u}^{1,1}, \cdots , \sigma (q_{i,j})\mathbf {u}^{i,j}, \cdots , \sigma (q_{H,W})\mathbf {u}^{H,W}]. \end{aligned}$$
(3)

Each value \(\sigma (q_{i,j})\) corresponds to the relative importance of a spatial information (ij) of a given feature map. This recalibration provides more importance to relevant spatial locations and ignores irrelevant ones. The architectural flow is shown in Fig. 1(c).

2.3 Spatial and Channel Squeeze & Excitation Block (scSE)

Finally, we introduce a combination of the above two SE blocks, which concurrently recalibrates the input \(\mathbf {U}\) spatially and channel-wise. We obtain the concurrent spatial and channel SE, \(\hat{\mathbf {U}}_{scSE}\), by element-wise addition of the channel and spatial excitation, \(\hat{\mathbf {U}}_{scSE} = \hat{\mathbf {U}}_{cSE} + \hat{\mathbf {U}}_{sSE}\). A location (ijc) of the input feature map \(\mathbf {U}\) is given higher activation when it gets high importance from both, channel re-scaling and spatial re-scaling. This recalibration encourages the network to learn more meaningful feature maps, that are relevant both spatially and channel-wise. The architecture of the combined scSE block is illustrated in Fig. 1(d).

Model Complexity: Let us consider an encoder/decoder block, with an output feature map of C channels. Addition of a cSE block introduces \(C^2\) new weights, while a sSE block introduces C weights. So, the increase in model complexity of a F-CNN with h encoder/decoder blocks is \(\sum _{i=1}^h (C_i^2 + C_i)\), where \(C_i\) is the number of output channels for the \(i^{th}\) encoder/decoder block. To give a concrete example, the U-Net in our experiments has about \(2.1 \times 10^6\) parameters. The scSE block adds \(3.3 \times 10^4\) parameters, which is an approximate increase by 1.5%. Hence, SE blocks only increase overall network complexity by a very small fraction.

3 Experimental Results

In this section, we conducted extensive experiments to explore the impact of our proposed modules. We chose three state-of-the-art F-CNN architectures, U-Net [3], SD-Net [4] and Fully Convolutional DenseNet [9]. All of the networks have an encoder/decoder based architecture. The encoding and decoding paths consist of repeating blocks separated by down-sampling and up-sampling, respectively. We insert (i) channel-wise SE (cSE) blocks, (ii) spatial SE (sSE) blocks and (iii) concurrent spatial and channel-wise SE (scSE) blocks after every encoder and decoder block of the F-CNN architecture and compare against its vanilla version.

Datatsets: We use two datasets in our experiments. (i) Firstly, we tackle the task of segmenting MRI T1 brain scans into 27 cortical and sub-cortical structures. We use the Multi-Atlas Labelling Challenge (MALC) dataset [11], which is a part of OASIS [12], with 15 scans for training and 15 scans for testing consistent to the challenge instructions. The main challenge associated with the dataset are the limited training data with severe class imbalance between the target structures. Manual segmentations for MALC were provided by Neuromorphometrics, Inc.Footnote 1 (ii) Secondly, we tackle the task of segmenting 10 organs on whole-body contrast enhanced CT (ceCT) scans. We use data from the Visceral dataset [13]. We train on 65 scans from the silver corpus, and test on 20 scans with manual annotations from the gold corpus. The silver corpus was automatically labeled by fusing the results of multiple algorithms, yielding noisy labels. The main challenge associated with the whole-body segmentation is the highly variable shape of the visceral organs and the capability to generalize when trained with noisy labels. We use Dice score for performance evaluation.

Model Learning: In our experiments, all of the three F-CNN architectures had 4 encoder blocks, one bottleneck layer, 4 decoder blocks and a classification layer at the end. The logistic loss function was weighted with median frequency balancing [8] to compensate for the class imbalance. The learning rate was initially set to 0.01 and decreased by one order after every 10 epochs. The momentum was set to 0.95, weight decay constant to \(10^{-4}\) and a mini batch size of 4. Optimization was performed using stochastic gradient descent. Training was continued till validation loss converged. All the experiments were conducted on an NVIDIA Titan Xp GPU with 12 GB RAM.

Table 1. Mean and standard deviation of the global Dice scores for the different F-CNN models without and with cSE, sSE and scSE blocks on both datasets.

Quantitative Results: Table 1 lists the mean Dice score on test data for both datasets. Results of the standard networks together with the addition of cSE, sSE and scSE blocks are reported. Comparing along the columns, we observe that inclusion of any SE block consistently provides a statistically significant (\(p\le 0.001\), Wilcoxon signed-rank) increase in Dice score in comparison to the normal version for all networks, in both applications. We further observe that the spatial excitation yields a higher increase than the channel-wise excitation, which confirms our hypothesis that spatial excitation is more important for segmentation. Spatial and channel-wise SE yields the overall highest performance, with an increase of 4–8% Dice for brain segmentation and 2–3% Dice for whole-body segmentation compared to the standard network. Particularly for brain, the performance increase is striking, given the limited increase in model complexity. Comparing the results across network architectures, DenseNets yield the best performance.

Fig. 2.
figure 2

Boxplot of Dice scores for all brain structures on the left hemisphere (due to space constraints), using DenseNets on MALC dataset, without and with proposed cSE, sSE, scSE blocks. Grey and white matter are abbreviated as GM and WM, respectively.

Figures 2 and 3 present structure-wise results for whole brain and whole body segmentation, respectively, for DenseNets. In Fig. 2, we observe that sSE and scSE outperform the normal model consistently for all the structures. The cSE model outperforms the normal model in most structures except some challenging structures like 3rd/4th ventricles, amygdala and ventral DC where its performance degrades. One possible explanation could be the small size of these structures, which might have got overlooked by only exciting the channels. The performance of sSE and scSE is very close. For whole body segmentation, in Fig. 3, we observe a similar pattern.

Fig. 3.
figure 3

Structure-wise Dice performance of DenseNets on Visceral dataset, without and with proposed cSE, sSE, scSE blocks. Left and right are indicated as L. and R. Psoas major muscle is abbreviated as PM.

Fig. 4.
figure 4

Input scan, ground truth annotations, DenseNet segmentation and DenseNet+scSE segmentation for both whole-brain MRI T1 (a–d) and whole-body ceCT (e–h) are shown. ROIs are indicated by white box and red arrow highlighting regions where the scSE block improved the segmentation, for both applications.

Qualitative Results: Figure 4 presents segmentation results for MRI T1 brain scan in Fig. 4(a–d) and for Whole body ceCT scans in Fig. 4(e–h). We show the input scan, ground truth annotations, DenseNet segmentation along with our proposed DenseNet+scSE segmentation. We highlight ROIs with a white box and red arrow, to show regions where inclusion of scSE block improved the segmentation. For MRI brain scan segmentation, we indicate the structure left putamen, which is under segmented using DenseNet (Fig. 4(c)), but the segmentation improves with the inclusion of the scSE block (Fig. 4(d)). For whole body ceCT, we indicate the spleen, which is over segmented using DenseNet (Fig. 4(g)), and which is rectified with adding scSE block (Fig. 4(h)).

4 Conclusion

We proposed the integration of squeeze & excitation blocks within F-CNNs for image segmentation. Further, we introduced the spatial squeeze & excitation, which outperforms the previously proposed channel-wise squeeze & excitation. We demonstrated that SE blocks yield a consistent improvement for three different F-CNN architectures and for two different segmentation applications. Hence, recalibration with SE blocks seems to be a fairly generic concept to boost performance in CNNs. Strikingly, the substantial increase in segmentation accuracy comes with a negligible increase in model complexity. With the seamless integration, we believe that squeeze & excitation can be a crucial component for neural networks in many medical applications.