<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Global Image Sentiment Transfer</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>01/10/2021</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10298824</idno>
					<idno type="doi">10.1109/ICPR48806.2021.9413221</idno>
					<title level='j'>IEEE International Conference on Pattern Recognition</title>
<idno></idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Jie An</author><author>Tianlang Chen</author><author>Songyang Zhang</author><author>Jiebo Luo</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Transferring the sentiment of an image is an unexplored research topic in computer vision. This work proposes a novel framework consisting of a reference image retrieval step and a global sentiment transfer step to transfer image sentiment according to a given sentiment tag. The proposed image retrieval algorithm is based on the SSIM index. The retrieved reference images by the proposed algorithm are more content-related than the algorithm based on the perceptual loss. Therefore, it can lead to a better image sentiment transfer result. In addition, we propose a global sentiment transfer step, which employs an optimization algorithm to iteratively transfer image sentiment based on the feature maps produced by the DenseNet121 architecture. The proposed sentiment transfer algorithm can transfer image sentiment while keeping the content of the input image intact. Both qualitative and quantitative evaluations demonstrate that the proposed sentiment transfer framework outperforms existing artistic and photo-realistic style transfer algorithms in producing satisfactory sentiment transfer results with fine and exact details.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>Transferring the sentiment of an image is an unexplored research topic. In contrast to the existing well-known tasks such as two-domain image-to-image translation <ref type="bibr">[1]</ref>- <ref type="bibr">[4]</ref> (e.g. winter &#8594; summer, cat &#8594; dog) and image style transfer (e.g. artistic style transfer, photo-realistic style transfer), image sentiment transfer focuses on modifying an image from a higher-level aspect to change its overall feeling to people. For example, without modifying the content, a family portrait can be transferred to be more positive so that the transferred image may give people a feeling of warmth and peace. As we live in an age of stress, we believe that this research topic is useful with its strong potential to improve people's lives.</p><p>Intuitively, image sentiment is an abstract concept. Compared with two-domain image-to-image translation that commonly has a definite pattern to transfer between two domains (e.g. cat &#8594; dog, horse &#8594; zebra), there are many ways to transfer an image to a specific sentiment. To make image sentiment transfer controllable, a reference image should be fed into the model as the guidance. Considering its similarity to the image style transfer task, we can leverage the existing image style transfer models to perform reference-guided image sentiment transfer. However, it is nontrivial to implement this design because of the poor compatibility between the input image and the reference image for image sentiment transfer. Moreover, directly using existing artistic and photo-realistic style transfer models generally fails to create visually pleasing results in terms of detail preservation and artifact/distortion Given an input image (a) and the adjectivenoun tag "lovely city"), we first retrieve a reference image (b) with the same content (noun) but the opposite sentiment ("cloudy city"). We then use a global sentiment transfer algorithm to generate (c), which contains the content of (a) and the sentiment description of (b). minimization. Compared with image style transfer for which an artistic or photo-realistic style can be indiscriminately added to any input image, the sentiment transfer between two content-unrelated images is risky. For the example of Fig. <ref type="figure">2</ref>, the sentiment transfer result lacks photo-realism because the reference image does not bring any content-related information.</p><p>To this end, we propose a new image sentiment transfer framework that starts with image retrieval. As shown in Fig. <ref type="figure">1</ref>, given an input image and a sentiment tag provided by the user, instead of randomly sampling a reference image that contains the input sentiment tag, we retrieve the most suitable reference image(s) based on the structural information of the input image. Leveraging the structural similarity score (SSIM) <ref type="bibr">[5]</ref>, the framework effectively constructs the content relation between the input and the reference image. In Section IV, we demonstrate that this image retrieval step is crucial to improving the performance of image sentiment transfer. To transfer the sentiment of the input image to that of the retrieved reference image, we design a novel global image sentiment transfer algorithm. Inspired by the image style transfer algorithm by Gatys et al. <ref type="bibr">[6]</ref>, we use an optimization algorithm on deep features from the neural networks pretrained on the ImageNet dataset <ref type="bibr">[7]</ref> to iteratively transfer the sentiment of the reference image to the input image. Unlike existing style transfer algorithms, our method adopts the DenseNet121 architecture as the feature extractor instead of the widely-used VGG19 architecture. We empirically find that DenseNet121 architecture outperforms VGG19 and other popular architectures in fine detail preservation and artifact/distortion minimization. Therefore, DenseNet121 is more suitable to implement sentiment transfer where the produced image should be photo-realistic.</p><p>Our main contributions are summarized as follows:</p><p>&#8226; We are the first to explore the task of image sentiment transfer. We present an effective two-step framework consisting of image retrieval and reference-guided image sentiment transfer. &#8226; We introduce a reference image retrieval algorithm based on the SSIM index, which can achieve better results than other methods in finding content-related reference images.</p><p>&#8226; We propose a global sentiment transfer algorithm based on DenseNet121, which can effectively transfer the sentiment/style of an image while preserving its fine details.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. RELATED WORK</head><p>Visual sentiment understanding has been explored in recent years. Most existing works focus on the visual sentiment classification tasks. To perform accurate classification for images with different sentiments, low-level features, like color <ref type="bibr">[8]</ref>- <ref type="bibr">[10]</ref>, texture <ref type="bibr">[10]</ref>, and shape <ref type="bibr">[11]</ref> have been studied in the early years. Later on, mid-level composition <ref type="bibr">[10]</ref>, sentributes <ref type="bibr">[12]</ref>, principles-of-art features <ref type="bibr">[13]</ref>, high-level adjective-noun pairs (ANP) <ref type="bibr">[14]</ref> are also proposed. Most recently, due to the rapid development of the convolution neural network (CNN) for extracting visual features, many approaches turn to CNNbased sentiment recognition. Some of them make use of noisy data during the training process <ref type="bibr">[15]</ref>- <ref type="bibr">[17]</ref>, while others explore visual sentiment at image region level <ref type="bibr">[18]</ref>- <ref type="bibr">[22]</ref>. However, compared with image sentiment classification, other sentimentrelated tasks such as image sentiment generation/translation have not been studied yet.</p><p>The most related tasks to ours are image-to-image translation and image style transfer. Image-to-image translation targets at learning an image-to-image mapping from two different domains. Early approaches need paired data to train the model and are essentially restricted to learning a deterministic one-to-one mapping <ref type="bibr">[23]</ref>- <ref type="bibr">[25]</ref>. This prevents the generation of diverse output images. CycleGAN <ref type="bibr">[2]</ref> first proposes a cycle consistency loss to enable the model to be trained from unpaired data. The following approaches such as MUNIT <ref type="bibr">[1]</ref> and DRIT <ref type="bibr">[3]</ref> further propose disentangled representations that enable the output images to be diverse. On the other hand, our task is also related to image style transfer. A great number of approaches are proposed for artistic style transfer <ref type="bibr">[26]</ref>- <ref type="bibr">[30]</ref> and photo-realistic style transfer <ref type="bibr">[31]</ref>- <ref type="bibr">[35]</ref>. Unlike the above approaches, we focus on image sentiment transfer that requires a strong content relation between the input and the reference image. Therefore, we retrieve reference image(s) based on the sentiment tag provided by the users instead of directly asking users to provide the information. The proposed global sentiment transfer algorithm is based on the work by Gatys etal. <ref type="bibr">[28]</ref>. However, our algorithm uses the DenseNet121 <ref type="bibr">[36]</ref> network architecture instead of VGG19 <ref type="bibr">[37]</ref> as the feature extractor since we empirically find that DenseNet121 can achieve more faithful input detail preservation compared with VGG19.</p><p>Retrieving a reference image by a given sentiment tag is related to the image retrieval task. Image retrieval aims at finding an image that is close to the given image. Most recent works measure the perceptual loss of images by comparing the image features extracted from pre-trained convolution neural networks <ref type="bibr">[38]</ref>. Unlike these works based on the perceptual loss, we find that the SSIM index <ref type="bibr">[5]</ref> is more suitable for retrieving reference images for sentiment transfer since it captures more structural similarity of images.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. METHOD</head><p>To transfer the global sentiment of an image, we propose a method that consists of a reference image retrieve step and a global sentiment transfer step. Fig. <ref type="figure">3</ref> shows the framework of the proposed algorithm. Given an input image, we first retrieve a reference image with the same content description but an opposite sentiment to the input image. Then a global sentiment transfer algorithm is employed to transfer the input image sentiment to the reference. We describe the details of these two steps in the following. .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Reference Image Retrieve</head><p>Retrieving a reference image is the initial step to make sentiment transfer. To achieve high quality sentiment transfer result while facilitating the following global sentiment transfer step, the retrieved image should have a similar content to the input image but contain the feelings of the target/opposite sentiment. To achieve this, we propose an image retrieval algorithm based on the Visual Semantic Odometry (VSO) <ref type="bibr">[39]</ref> dataset. For each image in the VSO dataset, an adjective-noun pair is attached to describe the semantic content (noun) and its sentiment (adjective), respectively. To retrieve a reference image according to a given sentiment tag, we first select a   subset of the VSO dataset, where every image within the subset contains the content tag (noun) of the input image but the sentiment tag (adjective) of the given target, For example, in Fig. <ref type="figure">3</ref>, the input image has an adjective-noun pair of "Ancient Forest" while images in the corresponding subset have a label of "Dark Forest". If the target sentiment tag is not available, the retrieval algorithm finds the reference image directly from a larger dataset whose images have the same content description (e.g., city) as the input image but contain the adjectives with the opposite sentiment. Although the input and reference images have the same "noun" tag, and therefore the reference image is likely to have similar content to the input image, the proposed reference retrieval algorithm is nontrivial because the VSO dataset is very noisy and contains many mislabelled data even after the cleaning. Therefore, it is necessary to select reference images carefully.</p><p>To find a reference image from the above-mentioned target subset, a metric to measure the distance between images is necessary. Inspired by <ref type="bibr">[33]</ref>, <ref type="bibr">[35]</ref>, we use the Structural Similarity Index (SSIM) <ref type="bibr">[40]</ref> to measure the semantic similarity between each image in the target subset and the input image. The SSIM index is originally used by image/video quality assessment methods. We empirically find that SSIM is more suitable than the widely-used perceptual loss to measure the semantic similarity between two images. For every image in the target subset &#8486; tar , we first compute the SSIM index between the evaluated and the input images and then pick the image with the highest SSIM index as the corresponding reference image to the input image,</p><p>Fig. <ref type="figure">6</ref> (b, e) shows the image retrieval results by the proposed algorithm. The retrieved images have the same content as the input images but different sentiment.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Global Sentiment Transfer</head><p>With the given input and a selected reference image structurally similar to the input image, we propose a novel algorithm to transfer the input image sentiment according to the selected reference image. Our algorithm is based on an optimization method, which iteratively transfers the sentiment of images by minimizing two objectives on deep features. The first objective is to keep the details of the input intact, while the second is to force the sentiment of the produced image similar to the reference image.</p><p>A high-quality sentiment transfer result should have a similar sentiment to the reference image while keeping the content details intact compared with the input image. The key challenge in sentiment transfer is to measure the sentiment similarity between two images. Inspired by Gatys et al. <ref type="bibr">[6]</ref>, <ref type="bibr">[41]</ref>, we adopt the Gram loss on the deep features of the input and reference images produced by neural networks to measure the sentiment similarity. Such a Gram-based loss term is originally used to measure image style similarity. Since sentiment can be regarded as higher abstraction of the style, we borrow the Gram loss term to implement sentiment transfer. Moreover, we compute the l 2 norm between the transferred and input image features as the content-consistency loss.</p><p>The sentiment/style transfer results created by the loss terms mentioned above rely heavily on deep features used to compute the objective functions. Many style transfer algorithms <ref type="bibr">[32]</ref>, <ref type="bibr">[41]</ref>- <ref type="bibr">[46]</ref> use the features produced by the VGG19 network pre-trained on the ImageNet dataset <ref type="bibr">[7]</ref>. However, the optimization algorithm based on the features of VGG19 can inevitably change the details of the content image. Take the style transfer results of Gatys et al. <ref type="bibr">[42]</ref> shown in Fig. <ref type="figure">5</ref> for example. The style transfer algorithm based on the features by VGG19 changes the details of the sea, sky, and plants in the input image.</p><p>As illustrated in Fig. <ref type="figure">4</ref>, the proposed algorithm adopts the DenseNet121 network pre-trained on the ImageNet dataset <ref type="bibr">[7]</ref> as the feature extractor. We empirically find that DenseNet121 can achieve good sentiment transfer effects while minimizing the influence to the input content's details. Using DenseNet121, we first obtain the deep features of the input and the reference images. These features are produced by the ReLU layers behind five pooling operators in the network. We use f i s , i &#8712; {1...5} and f i t , i &#8712; {1...5} to denote the feature maps of the input and reference image, respectively, where s denotes the source while t represents the target. DenseNet121 has two advantages: first, DenseNet121 can minimize the loss of the content information while achieving high-quality sentiment transfer. Second, DenseNet121 is more timeefficient because it contains only half of VGG19's parameters (DenseNet121: 6.952 v.s. VGG19: 12.945).</p><p>The overall loss functions we use is,</p><p>where Gram (f ) = f T &#8226; f , f i denotes the feature maps of the transferred images in DenseNet121. All the feature maps f has a shape of C&#215;(H &#215; W ), where C denotes the channel number while H, W represent the height and width of f , respectively. Note that the transferred image is modified iteratively as the variable in the optimization process to force its content to be the same as that of the input image while having the sentiment of the reference image.</p><p>IV. EXPERIMENT In this section, we first discuss the experimental settings and the dataset we use. We then compare the proposed image retrieval and global sentiment transfer algorithms with other image retrieval and image style transfer algorithms, respectively. We finally demonstrate the effectiveness of the proposed algorithms by both visual and quantitative evaluations.  Fig. <ref type="figure">6</ref>. Comparison between the proposed image retrieval method based on the SSIM index and the image retrieval method based on the perceptual loss. The proposed retrieval method focuses more on finding content-related images than the algorithm based on the perceptual loss.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Experimental Settings</head><p>Global Sentiment Dataset. To demonstrate the effectiveness of the proposed global sentiment transfer framework, we collect a few images from the VSO dataset. Since the original VSO dataset is noisy, we first filter the mislabeled images using the list given by <ref type="bibr">[47]</ref>. We then manually pick the images that have a global sentiment. For example, an image whose Adjective-Noun Pair (ANP) is "beautiful bird" should not be selected since "bird" is only an image region.</p><p>On the contrary, some ANPs such as "clear water" and the "lovely city" are selected because they describe global scene properties. The dataset we use contains 10,532 images with Global Sentiment Transfer Settings. To transfer the sentiment from the selected reference image to the input image, we propose an optimization-based iterative method. As stated above, we use the DenseNet121 pre-trained on the ImageNet dataset as the feature extractor. In the optimization process, we use the Adam algorithm <ref type="bibr">[48]</ref> to minimize the objective function between the input image and the retrieved reference image. To balance the content and sentiment loss functions, we set &#945; = 1 and &#946; = 1, 000, 000 in Equation <ref type="formula">2</ref>. Every inputreference pair takes 500 iterations to produce the sentiment transfer result.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Reference Image Retrieval</head><p>Fig. <ref type="figure">6</ref> shows the image retrieval results based on the perceptual loss and SSIM index. Since the perceptual loss concentrates less on the structure of the image content than the SSIM score, the retrieved images based on the perceptual loss generally have different content structures. On the contrary, the retrieved images by the algorithm based on the SSIM score usually contain the same content information as the input images. Take Fig. <ref type="figure">6</ref> for example. The retrieved images by the perceptual loss (c, f) have different content structures from (a) and (d), respectively. On the contrary, the input images (a, d) and the retrieved images by the SSIM index (b, e) have similar content structures. Generally, the global sentiment transfer algorithm would generate a better result if the reference image has a more similar content structure to the input image. Therefore, Fig. <ref type="figure">6</ref> demonstrates that the proposed image retrieval method based on the SSIM index outperforms algorithms based on the perceptual loss.</p><p>To quantitatively validate the above-mentioned observations, we compare the FID score <ref type="bibr">[50]</ref> between the retrieved image set and the input image set. We randomly select 380 images from the filtered global VSO dataset as the validation set to compute the FID score. The retrieved dataset consists of the reference images picked by the image retrieval method based on the evaluation set. FID is originally used to evaluate the performance of image generation methods. Since FID has an excellent ability to measure the distance between two image distributions, we borrow it from GANs <ref type="bibr">[50]</ref>- <ref type="bibr">[55]</ref> to evaluate the image retrieval performance. Table <ref type="table">I</ref> shows the FID score of the image retrieval method based on the SSIM index and the perceptual loss, respectively. Table <ref type="table">I</ref> demonstrates that the proposed method based on the SSIM score outperforms the image retrieval method based on the perceptual loss in finding the most structurally similar reference images.   </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Visual Comparison</head><p>Since this work is the first global sentiment transfer algorithm for arbitrary input images, we compare the result produced by our algorithm with both the state-of-the-art artistic <ref type="bibr">[27]</ref>, <ref type="bibr">[49]</ref>, <ref type="bibr">[56]</ref> and photo-realistic <ref type="bibr">[35]</ref> style transfer algorithms to demonstrate the effectiveness of the proposed global sentiment transfer method. Other photo-realistic style transfer algorithms such as <ref type="bibr">[31]</ref>- <ref type="bibr">[33]</ref> are not compared because these methods need a segmentation map or post-processing to implement style transfer. Ours and the compared methods do not need such a pre or post-processing step. To make a fair comparison, all of the compared style transfer algorithms use the same retrieved images produced by our image retrieval algorithm as the reference. Fig. <ref type="figure">7</ref> shows the sentiment transfer results of our method and the style transfer results by the state-of-the-art universal style transfer algorithms. The results by the artistic style transfer algorithms (e.g. StyleSwap <ref type="bibr">[56]</ref>,</p><p>WCT <ref type="bibr">[27]</ref>, AdaIN <ref type="bibr">[49]</ref>) often have distorted content details, which may be necessary to create artistic effects but are not desirable for producing good sentiment transfer results. The photo-realistic style transfer algorithm <ref type="bibr">[35]</ref> can preserve the content information. However, it can create significant artifacts. Take Fig. <ref type="figure">7 (f</ref>) for example. Fig. <ref type="figure">7</ref> (g) shows the results produced by our global sentiment transfer algorithm, which achieves the high-quality sentiment transfer effects while ensuring that the content details are not altered. Moreover, the results by our method contains significantly fewer artifacts than the state-of-the-art photo-realistic style transfer algorithms <ref type="bibr">[33]</ref>, <ref type="bibr">[35]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Quantitative Comparison</head><p>To quantitatively demonstrate the effectiveness of the proposed algorithm, we adopt the SSIM score and the FID score to evaluate the performance of the proposed algorithm. We    compute the SSIM index between the input image and the produced result to evaluate the content preservation ability of the algorithms. Moreover, we use the FID score between the reference image and the produced result to evaluate the sentiment transfer performance. In comparison, we collect 46 input-reference image pairs from the filtered global VSO dataset as the validation set. We obtain the sentiment/style transfer results by running all the compared algorithms on the validation set. Table . II shows the mean SSIM/FID scores of the compared algorithms on the validation set. The proposed global sentiment transfer algorithm has a higher mean SSIM score than other style transfer methods, demonstrating that our method has a stronger ability to preserve the details of the input image. In addition, the proposed algorithm also achieves a lower FID score, which indicates that the proposed algorithm outperforms other algorithms in creating a more similar sentiment to the reference image.</p><note type="other">Clear Lake Muddy Lake Scenic Valley Misty Valley</note></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>E. Comparison with Color Transfer Algorithms</head><p>Given an input image and a reference image, traditional color transfer algorithms <ref type="bibr">[57]</ref>, <ref type="bibr">[58]</ref> may be directly used to transfer the sentiment from the reference image to the input image. Fig. <ref type="figure">8</ref> compares the sentiment transfer results of our method with the traditional RCT <ref type="bibr">[57]</ref> and SOT <ref type="bibr">[58]</ref> color transfer algorithms. We empirically find that the color transfer algorithms have the advantage of generating clear results robustly. However, in certain cases, such an advantage can be a limitation. Take the bottom row of Fig. <ref type="figure">8</ref> for example, the results of the color transfer algorithms are compromised in transferring the "misty" sentiment, where the generated images should be blurry to create the "misty" feel. Because CNNs can recognize and separate different semantic contents, the proposed method can handle more complex color matching cases and transfer sentiment semantically. Take the top row of Fig. <ref type="figure">8</ref> for example, the transferred results by the proposed global sentiment transfer algorithm can change the sentiment of the water from "clear" to "muddy" while keeping the blue sky and red clothes almost intact. However, the color transfer algorithms <ref type="bibr">[57]</ref>, <ref type="bibr">[58]</ref> changes the blue sky and the red clothes because they can only match colors and thus cannot transfer sentiments according to image semantics.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>F. Failure Cases</head><p>Since global image sentiment transfer is an unexplored topic, the proposed algorithm is far from perfect. On the one hand, we find that the proposed algorithm is not robust on certain input and reference images (e.g., extremely dark images). On the other hand, as shown in Fig. <ref type="figure">9</ref>, the produced results may be less photo-realistic if the reference and the input image are not matched appropriately. We will address the above-mentioned failure cases in the future. Moreover, since the VSO dataset is fairly noisy and contains many mislabeled samples, it is valuable collect a more clean and specific dataset for the image sentiment transfer task.</p><p>V. CONCLUSION In this paper, we present a highly promising global image sentiment transfer framework consisting of a reference image retrieval step and a global sentiment transfer step. In the reference image retrieval step, we adopt the SSIM index instead of the perceptual loss to measure the scene structural distance between images. In the global sentiment transfer step, we use the DenseNet121 network pre-trained on ImageNet as the feature extractor and employ an image style transfer framework to iteratively transfer sentiment based on the features produced by the DenseNet121 architecture. Both qualitatively and quantitatively evaluations demonstrate that our algorithm outperforms existing style transfer algorithms in terms of the sentiment transfer effects and input detail preservation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VI. ACKNOWLEDGES</head><p>This work is supported in part by NSF awards IIS-1704337, IIS-1722847, and IIS-1813709, as well as our corporate sponsors.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0"><p>Authorized licensed use limited to: UNIVERSITY OF ROCHESTER. Downloaded on October 11,2021 at 15:12:48 UTC from IEEE Xplore. Restrictions apply.</p></note>
		</body>
		</text>
</TEI>
