{'fraction_non_alphanumeric': 0.03414176411144796, 'fraction_numerical': 0.009383571531687599, 'mean_word_length': 4.873251377702417, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Remove Appearance Shift for Ultrasound Image Segmentation via Fast and Universal Style Transfer

Deep Neural Networks (DNNs) suffer from the performance degradation when image appearance shift occurs, especially in ultrasound (US) image segmentation. In this paper, we propose a novel and intuitive framework to remove the appearance shift, and hence improve the generalization ability of DNNs. Our work has three highlights. First, we follow the spirit of universal style transfer to remove appearance shifts, which was not explored before for US images. Without sacrificing image structure details, it enables the arbitrary style-content transfer. Second, accelerated with Adaptive Instance Normalization block, our framework achieved real-time speed required in the clinical US scanning. Third, an efficient and effective style image selection strategy is proposed to ensure the target-style US image and testing content US image properly match each other. Experiments on two large US datasets demonstrate that our methods are superior to state-of-the-art methods on making DNNs robust against various appearance shifts.


INTRODUCTION
In recent years, Deep Neural Networks (DNNs) have dominated the field of medical image analysis [1]. However, DNNs have the performance degradation when image appearance shift exists between the model training and testing phases. Therefore, DNNs cannot guarantee the accuracy in real clinical scenarios [2,3]. † Authors contributed equally.
* Corresponding author: nidong@szu.edu.cn.  The situation becomes more severe for DNNs based ultrasound (US) image segmentation. As shown in Fig.1, there are two groups of US images from the prenatal scan. With different Time Gain Compensation (TGC) settings, tissues intensity in different depths are affected. The original US image changes into variants with obvious and typical appearance shift. A well-trained DNN then presents dramatically different segmentation results on the variants. Therefore, making DNNs robust against appearance shift on US images is highly desired. However, this task is non-trivial. First, DNN models in clinical US analysis are facing an open scenario, where DNNs only have access to limited source domain images/labels, and are blinded to target domain samples. Second, varitions in acoustic attenuation, scan operators, US machines, probes and empirical imaging parameters often make appearance shift unpredictable and hard to model.
Recently, Domain Adaptation (DA) was frequently used to remove image appearance shift. Kamnitsas et al. [4] proposed to align domain features, but it needs a large number of images and labels from the target domain, which is infeasible in clinic scenario. Based on Cycle-GAN [5], translating the image appearance among domains [6] and shape guided image translation [7] were proposed. However, GAN-based methods often introduce artifacts into the original image and make the image distorted. In addition, DA often limits itself among a fixed number of domains with limited appearance shift. This is not suitable for the open scenario with unpredictable image appearance shift. By revisiting the style transfer [8], Ma et al. built an online scheme to remove appearance shift in the cardiovascular magnetic resonance (MR) image segmentation [9]. However, their style transfer method is unstable and may destroy image details. In [10], a new style transfer method, called STROTSS, was proposed to preserve image details for any style-content pairs during transfer. STROTSS is promising but it is time-consuming. It also outputs random results due to the resampling of hypercolumns.
In this paper, on the basis of Wavelet Corrected Transfer network (WaveCT) [11] and Adaptive Instance Normalization (AdaIN) [12], we propose a novel and general style transfer framework to remove US image appearance shift (denoted as WaveCT-AIN). Our framework has three highlights: (a) It is the first work to explore universal style transfer for US image segmentation. WaveCT-AIN preserves the image structure details and enables arbitrary style-content transfer between images. Unpredictable US image appearance shifts are consistently tackled under this framework. (b) Compared to STROTSS, our WaveCT-AIN is lightweight and satisfies the real-time requirements. With AdaIN block for acceleration, it only takes 0.07s for an inference. (c) An efficient and effective style image selection strategy is also adopted to retrieve suitable and appearance-invariant US style image for optimized style transfer. Experiments on two US datasets demonstrate that the proposed WaveCT-AIN obtained a superior performance than the state-of-the-art methods.

METHODOLOGY
The proposed framework is shown in Fig. 2. It consists of a style selection module S c , a style transfer module S t (WaveCT-AIN-D) and a segmentor S g . For a testing content image, S c retrieves an US style image from source domain as a reference and inputs it to S t . Then, S t instantly removes the appearance shift in content image and makes it suitable for S g to segment.

Universal and High Quality Style Transfer
Style transfer can remove appearance shift to approach robust US image analysis. To meet clinical US scanning requirements, following aspects should be considered: (a) The method should enable universal transfer between any stylecontent image pairs. (b) Transfer results should be stable rather than fluctuant [9,10]. (c) Image structure details should be highly preserved. (d) Transfer process should be fast to avoid high latency [10]. (e) The method should provide style selection strategy to provide case-specific style transfer. In order to meet all the above needs, we adopt the WaveCT network recently used in WCT 2 [11]. As shown in Fig. 2, style image and content image are hierarchically processed by the encoder-decoder network in WaveCT. At several sites, multi-scale style information is distilled from the feature maps of style image. Style information is then transferred to modulate the feature maps of content image by style transform block. With the modulated features, decoder reconstructs the stylized content image.
Different from previous online style transfer methods which may distort image details [9], the proposed WaveCT has two main advantages. First, WaveCT replaces vanilla max-pooling/unpooling layers with the Haar wavelet pooling/unpooling layers, which can exactly reconstruct the stylized image with minimal structure loss. Second, WaveCT splits the features into low-frequency and high-frequency components via Haar wavelet pooling. The low-frequency captures smooth textures while the high-frequency extracts edge-like features. WaveCT only passes the low-frequency in the main network and skips the high-frequency to the decoder. Due to this layout, WaveCT with style transform block can achieve universal and high quality stylization as we expected.

Accelerating the Style Transfer
WaveCT associated with the style transform block, i.e., whitening and coloring transforms (WCT) [13], is the workhorse of WCT 2 [11]. Although effective, WCT 2 has high computation latency. Specifically, WCT firstly applies whitening transformation to erase the style information in the content feature map, and then a coloring transformation to render the texture of style image to the whitening result. Since these two steps involve heavy computation among multiple large matrices, WCT 2 needs about 4.58 seconds for an inference, which is not acceptable in US image analyses.
To accelerate the transfer, we propose to upgrade all the WCT block in WCT 2 to a new block, AdaIN [12]. The modified system, i.e., WaveCT with AdaIn, is denoted as WaveCT-AIN. AdaIN is a variant of Instance Normalization. It only needs to align the channel-wise mean µ and standard devia-tion σ of content feature maps x to match those of target-style feature maps y: AdaIN is lightweight, which significantly reduces the computation cost. Considering the fact that TGC changing along the depth is the main reason for the appearance shift in US image, we further modify the AdaIN into a depth-encoded version, AdaIN-D. Specially, as illustrated in Fig.3, where a window sliding along the depth is employed (Fig.3(a)). The bandwidth and stride are set to two-thirds and one third height of content image respectively. Then we perform AdaIN transform for each region x i (i=1,2) and average the overlap.

Case-specific Style Image Selection
Due to the unpredictable appearance shift in testing images, style image should be adaptively determined to provide casespecific guidance. To achieve this, we propose a Local Binary Patterns (LBP) feature [14] based histogram matching strategy to improve the selection of style image. LBP is superior in capturing image textures and invariant to the changes in grayscale and rotation. Based on the style image library from the source domain, the proposed strategy includes three steps. First, we obtain the histograms of testing content image c and all the style images in the library according to the corresponding LBP feature spectrum. Second, the top-10 relevant style images are retrieved via the LBP histogram correlation. Third, to further eliminate the gap between the testing image and the retrieved style images, we localize the final style image with the smallest Euclidean distance.
Since AdaIN is sensitive to the mean and variance of style image, in the third step above, we require the mean and variance of the target style image S T to be as close as possible to those of content image c instead.
where s i is each retrieved style image from the second step. µ and σ are the mean and variance of the whole image.
Our proposed style selection strategy is effective and not only applicable to our WaveCT-AIN-D, but also to the classic method in [8]. In Fig. 4, we show the sorted segmentation results on an testing content image which is transferred from 222 style library images. Among all the results, our strategy hits a proper style image and generates superior segmentation results (red diamond), which indicates that our selected style can properly help remove the appearance shift.

Datasets and Implementation Details
Datasets. Our methods were tested on 180 groups of fetal head (FH) and 198 groups of fetal abdomen (FA) US images. Each group consists of one original US image and four variants with different TGC (see Fig.1). Approved by local IRB, all the images were anonymized and obtained by experienced experts using a Siemens system. Testing images cover the gestational age from 20 to 30 weeks. An expert provided delineation ground truth for all the images. Furthermore, 222 FH and 200 FA US images acquired by a GE scanner serve as the style image library. Implementation Details. We freeze the encoder of WaveCT-AIN-D with VGG encoder weights. The decoder is firstly pre-trained on Microsoft COCO dataset and then fine-tuned with 3,000 US images, minimizing the L2 reconstruction loss. We use Adam optimizer with learning rate 10 −3 . In the style selection, we use LBP with uniform pattern and set the neighbour points to 8, the radius to 3. For the segmentation model, we choose the MobileNetV3-Large with a segmentation head as our segmentor backbone. Adam with learning rate 10 −4 is adopted to train segmentor using an augmented source domain training set of 10,000 US images. Segmentor is pre-trained on the source domain without TGC change and frozen during testing.

Results
The quantitative comparisons between WaveCT-AIN-D and other methods on FA and FH ultrasound (US) images are summarized in Table 1 and 2, respectively. Specifically, "SS" denotes the method with our style selection, "fix" denotes the method evaluated on the average of all the style library images based style transfer results. Runtime comparison. The last columns in Table 1 and 2 show the runtime comparisons among different methods using a single GTX 1080 Ti. We used the same hyperparameter settings in [9] for Gatys et al. [8] and followed the original settings in STROTSS [10]. The online style transfer methods above require much time to iteratively reconstruct a fluctuating stylized result, which goes against the clinical requirements. Because AdaIN [12] is much simpler than WCT [13], the proposed WaveCT-AIN has improved the speed around 60 times when compared to WCT 2 [11].
Visual quality comparison. To evaluate the visual quality, we calculated the structural similarity (SSIM) and Peak Signal to Noise Ratio (PSNR) between original images and stylized results. Based on the SSIM and PSNR in Table 1 and 2, we can see that the visual quality of our method is superior to other methods. Moreover, in Gatys et al. [8], the visual quality of stylized results with average style transfer (fix) is much worse than the results based on style selection (SS) method. In contrast, the proposed WaveCT-AIN-D is robust to the style change.
Segmentation performance comparison. As shown in Table 1 and 2, histogram equalization (HE) still suffer from appearance shift, but the proposed WaveCT-AIN-D (SS) obtain the highest Dice of 94.05% and 97.31% for FA and FH, respectively, which are also higher than without processing (91.0%). Compared to other methods, our proposed methods have also achieved significant improvement in terms of Hausdorff distance boundary (Hdb) and Jaccard. Fig.5 demonstrates the effectiveness of WaveCT-AIN-D.

CONCLUSIONS
In this paper, we proposed a novel style transfer framework, called WaveCT-AIN-D, to eliminate image appearance shift in US image segmentation. The proposed method is faster, more stable and efficient than the state-of-the-art methods. In addition, we explored a style selection method to match style-content pairs appropriately. Future study may focus on validating the proposed framework on other modalities and clinical practice.