<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Visual Sentiment Analysis Multiplying Deep learning and Vision Transformers</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Tetsuya Asakawa</string-name>
          <email>asakawa.tetsuya.um@tut.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Riku Tsuneda</string-name>
          <email>tsuneda.riku.am@tut.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Masaki Aono</string-name>
          <email>masaki.aono.ss@tut.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Toyohashi University of Technology</institution>
          ,
          <country country="JP">Japan</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2021</year>
      </pub-date>
      <fpage>13</fpage>
      <lpage>15</lpage>
      <abstract>
        <p>Visual sentiment analysis investigates sentiment estimation from images and has been an interesting and challenging research problem. Most studies have focused on estimating a few specific sentiments and their intensities using several complex CNN models. In this paper, we propose multiplying CNN and Vision Transformers method in MediaEval 2021 Visual Sentiment Analysis: A Natural Disaster Use-case. Specifically, we first introduce our proposed model used in subtask1. Then, we also introduce a median-based multi-label prediction algorithm used in Subtask 2 and 3, in which we assume that each emotion has a probability distribution. In other words, after training of our proposed model, we predict the existence of an evoked emotion for a given unknown image if the intensity of the emotion is larger than the median of the corresponding emotion. Experimental results demonstrate that our model outperforms several models in terms of subset Weighted F1-Score.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 INTRODUCTION</title>
      <p>With the spread of SNS and the Internet, a vast number of
images are widely available. As a result, there is an urgent
requirement for image indexing and retrieval techniques. When
viewing an image, we can feel several emotions simultaneously.
Different visual images have different emotional triggers. For
instance, an image with a snake or a spider may most likely
trigger a bad feeling like “disgust” or “fear,” whereas an image
with a flower may most likely trigger a good feeling like
“amusement” or “excitement”.</p>
      <p>
        Visual sentiment prediction investigates sentiment estimation
from images and has been an interesting and challenging research
problem. In this paper, the purpose is to accurately estimate the
sentiments as a single-label and multi-label multi-class problem
from given images that evoke multiple different emotions
simultaneously [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>We also introduce a new combined neural network model
which allows inputs coming from both ViT features and
pretrained CNN features. In addition, existing deep learning had
weak classifications, therefore we propose a new fully connected
2 layers. The new contributions of this paper include (1) propose a
novel feature considering both ViT and CNN features to predict
sentiment of images, unlike most recent research which only
concerns adopting CNN features, (2) propose a combined feature
method to combine the output of each feature, unlike previous
work which focuses on combining feature vectors.
2</p>
    </sec>
    <sec id="sec-2">
      <title>APPROACH</title>
      <p>We propose single-label (Subtask1) and multi-label (Subtask2
and 3) visual sentiment analysis system to predict multiple
emotions. And we will describe our deep neural network model
that enables the single-label and multi-label outputs, given images
that evoke emotions.
2.1</p>
      <p>This is a multi-class single label classification task, where the
images are arranged in three different classes, namely positive,
negative, and neutral. There is a strong imbalance towards the
negative class, given the nature of the topic.</p>
      <p>To solve our multi-class, single-label classification problem,
we propose new combined neural network models which allow
inputs coming from both End-to-end (Vision Transformers: ViT
and CNN) features.</p>
      <p>
        As illustrated in Figure 1, we adopt ViT-L/16 at ViT and
extracted features. On the other hand, CNN features extracted
from a pre-trained CNN-based neural network include
EfficientNetB0[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>- Vision Transformers (ViT)</p>
      <p>
        The Vision Transformer is a model for image classification
that employs a Transformer-like architecture over patches of the
image. This includes the use of Multi-Head Attention, Scaled
DotProduct Attention and other architectural features seen in the
Transformer architecture traditionally used for NLP[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
-CNN
      </p>
      <p>In addition to ViT features described above, our system
incorporates CNN features, which can be extracted from
pretrained deep convolutional neural networks with EfficientNetB0.
Because of the lack of dataset in visual sentiment analysis, we
adopt transfer learning in our feature to prevent over fitting.</p>
      <p>We decrease the dimensions of fully-connected layers used in
CNN models. Specifically, for EfficientNetB0, we extract a
1280dimensional vector from ‘Global Average Pooling 2D’layer (or
the second to the last fully-connected layer), and reduce the vector
to 512 dimension by applying a fully-connected layer.
2.2</p>
    </sec>
    <sec id="sec-3">
      <title>Subtask2 and 3</title>
      <p>In Subtask 2 and 3, this is a multi-class multi-label image
classification task, where the participants are provided with
multilabeled images.</p>
      <p>To solve our multi-class, multi-label classification problem,
we propose new combined neural network models which allow
inputs coming from both End-to-end (ViT and CNN) features. We
adopt ViT-L/16 at ViT and extracted features. On the other hand,
CNN features extracted from a pre-trained CNN-based neural
network, include EfficientNetB0.</p>
      <p>To deal with the above combined features, we proposed a deep
neural network architecture where we allowed multiple inputs and
a multi-hot vector output. The combined feature is represented by
the following formula:
  = (!() + "())</p>
      <p>Based on this formula, after the training process, we allowed
our neural network system to predict the visual sentiment of
unknown images as a multi-label multi-class classification
problem.</p>
      <p>-multi-label prediction</p>
      <p>
        To detect a multi-hot vector, we employed a method based on
our research [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. We proposed a method illustrated in Algorithm 1.
The input is a collection of features extracted from each image
with K kinds of sentiments, while the output is a K-dimensional
multi-hot vector.
(1)
Algorithm 1: Predicting multi hot vector for an image
In Algorithm 1, we assumed that the extracted features (here
ViT and CNN) are represented by their probabilities. For each
sentiment, we summed up the features, followed by averaging the
result, which is denote by #$ in Algorithm 1.
      </p>
      <p>We used a fixed threshold for sentiment, and adopted “0.5” for
each feature, which we employed as the threshold of the
corresponding emotion evocation. After obtaining all the
thresholds dynamically determined based on this threshold, the
multi-hot vector of each image is generated such that if #$ is
equal to or greater than the thresholds, we set #$ =1; otherwise
#$=0, where #$ is the element of K-th sentiment of i-th image. In
short, the vector # represents the output multi-hot vector. We
repeated this computation until all the test (unknown) images
were processed.</p>
    </sec>
    <sec id="sec-4">
      <title>3 EXPERIMENTAL RESULTS</title>
      <p>Here we describe experiments and the evaluations. And, we
have divided the training dataset into training and validation data
with an 8:2 ratio. We determined the following hyper-parameters;
batch size as 256, optimization function as “SGD” with a learning
rate of 0.001 and momentum 0.9, and the number of epochs 200.
For the evaluations of single-label and multi-label classification,
we employed Weighted F1-Score.</p>
      <p>Here we compare in terms of Weighted F1-Score. Also, the
table includes several base line methods including ViT,
EfficientNet B0, and our proposed combined model. The “Dim”
column of the table represents the feature dimension. For our
proposed combined model, we have tested with one variation, i.e.,
ViT+ EfficientNet B0. For our proposed combined model, it turns
out that ViT+EfficientNet B0 has the best score. It is observed
that the proposed method could correctly recognize the images
whose emotions are falsely classified by the base CNN.</p>
    </sec>
    <sec id="sec-5">
      <title>4 CONCLUSIONS</title>
      <p>We proposed a model for Visual Sentiment Analysis: A
Natural Disaster Use-case which accurately estimates single-label
and multi-label multi-class problems from given images, evoking
multiple different emotions simultaneously.</p>
      <p>Our proposed model is simple yet effective and achieves new
state-of-the-art performance on multiple datasets.</p>
    </sec>
    <sec id="sec-6">
      <title>ACKNOWLEDGMENTS</title>
      <p>A part of this research was carried out with the support of the
Grant for Toyohashi Heart Center Smart Hospital Joint Research
Course and the Grant for Education and Research in Toyohashi
University of Technology.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>H</given-names>
            <surname>,</surname>
          </string-name>
          <article-title>Syed Zohaib and Ahmad, K and Riegler, M and Hicks, S and Conci</article-title>
          ,
          <string-name>
            <given-names>N</given-names>
            , and
            <surname>Halvorsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P</given-names>
            and
            <surname>Al-Fuqaha</surname>
          </string-name>
          ,
          <string-name>
            <surname>A AlFuqaha</surname>
          </string-name>
          ,
          <year>2021</year>
          , December.
          <article-title>Visual Sentiment Analysis: A Natural Disaster Use-case Task at MediaEval 2021</article-title>
          .
          <source>In Proceedings of the MediaEval 2021 Workshop</source>
          , Online.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Tan</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Le</surname>
            ,
            <given-names>Q.V.</given-names>
          </string-name>
          :
          <article-title>Efficientnet: Rethinking model scaling for convolutional neural networks</article-title>
          .
          <source>ICML</source>
          <year>2019</year>
          (05
          <year>2019</year>
          ), https://arxiv.org/pdf/
          <year>1905</year>
          .11946.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Dosovitskiy</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Beyer</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kolesnikov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weissenborn</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhai</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Unterthiner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Houlsby</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <year>2020</year>
          .
          <article-title>An image is worth 16x16 words: Transformers for image recognition at scale</article-title>
          . arXiv preprint arXiv:
          <year>2010</year>
          .11929.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Asakawa</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Aono</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>2019</year>
          .
          <article-title>Median based Multi-label Prediction by Inflating Emotions with Dyads for Visual Sentiment Analysis</article-title>
          .
          <source>In 2019 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA ASC)</source>
          (pp.
          <fpage>2008</fpage>
          -
          <lpage>2014</lpage>
          ). IEEE.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>