The single-task TransUNet [1]} follows the basic design of UNet [2]} that utilizes skip connections between corresponding layers to enhance local details in feature maps. Due to the intrinsic locality in convolution, UNet is weak to model long-range dependencies, thus subpar to tackle situations such as segmenting large regions in skin images. Under this circumstance, TransUNet introduces a strong encoder by incorporating several Transformer layers during feature extraction (refer to green rectangles in Figure REF ). Specifically, given a skin image \(I \in \mathbb {R}^{H \times W \times C}\) , the encoder first downsamples \(I\)  for four times using ResNet50 [3]} and generate a feature map \(F \in \mathbb {R}^{H^{\prime } \times W^{\prime } \times C^{\prime }}\) . The generated feature map is further split into \(N\)  non-overlapping patches \(\lbrace \mathbf {x}^{i}_{s} \in \mathbb {R}^{P^{2} \cdot C^{\prime }} | i=1,2,...,N\rbrace \)  as segmentation tokens, each of which is of size \(P \times P\)  and \(N = \frac{H^{\prime }W^{\prime }}{P^{2}}\) . Here we append an additional zero-initialized classification token \(\mathbf {x}_{c}\)  to build up a multi-task framework. Each of the tokens is mapped to a latent \(D\) -Dimensional embedding space through a learnable linear projection \(\mathbf {E}\) . Different from the original implementation of TransUNet, we discard the positional embedding for the convenience of multi-scale inputs during testing. We highlight that the deep backbone can obtain the positional cues through padding [4]}. Hence, the list \(\mathbf {z}_{0}\)  of embedded tokens are as follows:
\(\mathbf {z}_{0} = [\mathbf {x}^{1}_{s}\mathbf {E}; \mathbf {x}^{2}_{s}\mathbf {E}; \cdots ; \mathbf {x}^{N}_{s}\mathbf {E}; \mathbf {x}_{c}\mathbf {E}]\) 
