<!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>Transfer learning with CNN architectures for classifying gastrointestinal diseases and anatomical landmarks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Danielle Dias</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ulisses Dias</string-name>
          <email>ulisses@ft.unicamp.br</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Campinas</institution>
          ,
          <country country="BR">Brazil</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <fpage>29</fpage>
      <lpage>31</lpage>
      <abstract>
        <p>Transfer learning is an approach where a model trained for a given task is used as a starting point on a second task. Many advanced deep learning architectures have been pre-trained on ImageNet and are currently available, which makes this technique very popular. We evaluate 10 pre-trained architectures on the task of nding gastrointestinal diseases and anatomical landmarks in images collected in hospitals. Our analysis considered both processing time and accuracy. We also study if global image features bring advantages to the pre-trained models for the problem of gastrointestinal medical image classi cation. Our best models achieved accuracy and F1-score values of 0.988 and 0.908, respectively. Our fastest model classi es an input instance in 0.037 seconds, and yields accuracy and F1-score of 0.983 and 0.866, respectively.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>INTRODUCTION</title>
      <p>
        The Medico Task proposes the challenge of predicting diseases
based on multimedia data collected in hospitals [
        <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
        ]. The images
are frames collected from videos captured by the insertion of a
camera in the gastrointestinal tract. The main purpose is to identify
anomalies that can be detected visually, even before they become
symptomatic. More details can be found in the task overview [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>To solve the task we created several models based on features
extracted from deep convolutional architectures and global image
features. The deep architectures were trained on ImageNet. The
strategy was to create three kinds of models: (i) those having only
features extracted from deep architectures as input, (ii) those that
considered only global image features, and (iii) those created with
all features available.</p>
      <p>The approach of extracting features from pre-trained models
is usually referred to as transfer learning. It has become
popular because many models are available. We selected 10
architectures trained on ImageNet as extractors, and compared their
performance on classifying images for the Medico Task.</p>
      <p>The architectures di er in several characteristics, which impacts
the time to compute the features. Since e ciency is an important
matter on this task, we computed the data processing speed for
each test images and made e orts to reach a balance between
solution quality and running time.</p>
    </sec>
    <sec id="sec-2">
      <title>RELATED WORK</title>
      <p>
        Transfer learning has been used in several problems in a number of
domains. In 2017, Agrawal et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] used transfer learning for the
Medico Task when the challenge had 8 classes and achieved good
results. They restricted the analysis to two architectures:
InceptionV3, and VGGNet. They also conducted an analysis of how a model
performs if it uses features extracted from both architectures as
input. The results are better for just a small factor, which lead us
believe that it does not worth the extra processing time. We
extended the work of Agrawal et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] by using 10 architectures and
by considering both solution quality and e ciency in our analysis.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>APPROACH</title>
      <p>
        The development and test dataset contain 5,293 and 8,740 images,
respectively. For each image, visual features were extracted and
provided as feature vectors by the task organizers, namely: JCD,
Tamura, ColorLayout, EdgeHistogram, AutoColorCorrelogram and
PHOG [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. These feature vectors are sequences of oating point
values for each image, and the number of values sum to 1185. These
values were joined to form a table used as input to our model,
where rows represent images. We removed 19 columns because
either they had the same value for all images or because they were
duplicated.
      </p>
      <p>
        We used 10 architectures trained on ImageNet: DenseNet121 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ],
DenseNet169 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], DenseNet201 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], InceptionResNetV2 [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ],
InceptionV3 [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], MobileNet [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], ResNet [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], VGG16 [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], VGG19 [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ],
Xception [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Each architecture requires a particular pre-processing
step and returns vectors of oating point numbers. Vector sizes
are: DenseNet121 (1024), DenseNet169 (1664), DenseNet201 (1920),
InceptionResNetV2 (1536), InceptionV3 (2048), MobileNet (1024),
ResNet (2048), VGG16 (512), VGG19 (512), Xception (2018).
      </p>
      <p>The input layer has the same number of nodes as the feature
vector sizes. That said, in a model that uses only global features
the input layer has 1166 nodes. In a model that uses global features
and a given architecture as feature extractor, the input layer has the
feature vector of that architecture plus 1166.</p>
      <p>The best model for most of the input features uses one hidden
layer that has 512 nodes and each node uses Relu as activation
function. We added a Dropout of 50% in the training stage and l2
regularization to prevent over t. Models with more layers tend to
over t very easily with just a few epochs. It would be possible to
create simpler models for small feature vectors like VGG
architectures, but we decided to report the same network for all input
vectors for comparison purposes. The output layer has 16 nodes (one
for each class) and uses softmax activation to classify the image in
one of the classes.
4</p>
    </sec>
    <sec id="sec-4">
      <title>RESULTS AND ANALYSIS</title>
      <p>During the training stage we split the development set with 5,293
images into train (3,038 images), validation (1,722 images), and test
(531 images) datasets. We used train and validation sets to train and
tune the classi er. Test dataset was used only once to generate the
results in Table 1 after we were satis ed with the validation scores.</p>
      <p>The model that uses only global image features yields an
accuracy of 0.813, and F1-score of 0.782, which we consider a baseline
result. Table 1 summarizes the results using transfer learning in the
test dataset with 531 images. We based our decision about which
model was best to submit on the F1-score and accuracy metrics.</p>
      <p>Our rst decision was to disregard the models that had
transfer learning plus global features because the improvement after
adding global features was considered irrelevant. As an example,
the architecture DenseNet201 had a small increase of accuracy from
0.923 to 0.925. These were the best models using accuracy metric.
If we consider the F1-score, models with global image features
became even worse in several cases. Taking into account that these
models with global features have 1166 more inputs than their
counterparts, we decided to keep the simpler models.</p>
      <p>DenseNet201 and Resnet were selected as the two best models
considering accuracy and F1-score, respectively. MobileNet was
selected because it is amazingly fast, and e ciency is an important
matter on this task. Indeed, we consider this model the best
tradeo since its 0.889 of accuracy is not far away from the 0.923
accuracy of DenseNet201 (best accuracy model) and runs 6.5 times
faster. DenseNet121 was the last model selected because is
somewhere in between the best accuracy model (DenseNet201) and the
fastest model (Mobilenet).</p>
      <p>Selected models were submited and evaluated against the dataset
with 8,740 images. In this dataset, our results were much better
than we anticipated. Results are shown in Table 2, where we also
report the o cial competition ranking indicator Rk . ResNet and
DenseNet models achieved accuracy higher than 0.987. Mobilenet
yields accuracy of 0.983, which is very close to the top accuracy of
0.988 achieved by DenseNet201 and Resnet.</p>
      <p>F1-score shows that Resnet and DenseNet201 are the best
models and that MobileNet is somewhat worse than the others.
However, we believe MobileNet has best trade-o if we consider that it
returns solution in much less than a second. DenseNet121 does not
appear a good choice because it is slower than Resnet and present
somewhat worse results. Therefore, Resnet should be preferred in
any situation. DenseNet201 was the top accuracy and F1-score, but
it is so close to Resnet that it is di cult to argue that it is enough
compensation for the fact of being twice as slower.</p>
    </sec>
    <sec id="sec-5">
      <title>DISCUSSION AND OUTLOOK</title>
      <p>We believe these models can be improved and the confusion matrix
shown in Figure 1 provides some insights. We analysed how they
performed in each of 16 class and found out that the class
“out-ofpatient” is particularly problematic, since it has only 4 instances in
the development set and 5 instances in the test set. Furthermore,
none of our models was able to classify these 5 instances right,
which does not impact accuracy but degrades F1-score. In the
future, some data augmentation should be performed to improve this
class.</p>
      <p>Another class we need to study is “esophagitis”, because 170
instances were classi ed as “normal-z-line”, which accounts for
30.57% of instances in this class. The classes “Stool-plenty” and
“colon-clear” have most of the instances, and our models did a good
job on classifying them right, which boosted the scores.</p>
    </sec>
    <sec id="sec-6">
      <title>ACKNOWLEDGMENTS</title>
      <p>We thank CAPES and CNPq (grant 400487/2016-0).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Taruna</given-names>
            <surname>Agrawal</surname>
          </string-name>
          , Rahul Gupta, Saurabh Sahu, and Carol Y EspyWilson.
          <year>2017</year>
          .
          <article-title>SCL-UMD at the Medico Task-MediaEval 2017: Transfer Learning based Classi cation of Medical Images.</article-title>
          .
          <source>In Proceedings of the MediaEval 2017 Workshop.</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>François</given-names>
            <surname>Chollet</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Xception: Deep Learning with Depthwise Separable Convolutions</article-title>
          .
          <source>CoRR abs/1610</source>
          .02357 (
          <year>2016</year>
          ). arXiv:
          <volume>1610</volume>
          .02357 http://arxiv.org/abs/1610.02357
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Andrew</surname>
            <given-names>G.</given-names>
          </string-name>
          <string-name>
            <surname>Howard</surname>
            , Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and
            <given-names>Hartwig</given-names>
          </string-name>
          <string-name>
            <surname>Adam</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>MobileNets: E cient Convolutional Neural Networks for Mobile Vision Applications</article-title>
          . (04
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Kaiming</given-names>
            <surname>He</surname>
          </string-name>
          , Xiangyu Zhang, Shaoqing Ren, and
          <string-name>
            <given-names>Jian</given-names>
            <surname>Sun</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>Deep Residual Learning for Image Recognition</article-title>
          .
          <source>CoRR abs/1512</source>
          .03385 (
          <year>2015</year>
          ). arXiv:
          <volume>1512</volume>
          .03385 http://arxiv.org/abs/1512.03385
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Gao</given-names>
            <surname>Huang</surname>
          </string-name>
          , Zhuang Liu, and
          <string-name>
            <surname>Kilian</surname>
            <given-names>Q.</given-names>
          </string-name>
          <string-name>
            <surname>Weinberger</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Densely Connected Convolutional Networks</article-title>
          .
          <source>CoRR abs/1608</source>
          .06993 (
          <year>2016</year>
          ). arXiv:
          <volume>1608</volume>
          .06993 http://arxiv.org/abs/1608.06993
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Mathias</given-names>
            <surname>Lux</surname>
          </string-name>
          and
          <article-title>Savvas A</article-title>
          . Chatzichristo s.
          <year>2008</year>
          .
          <article-title>Lire: Lucene Image Retrieval: An Extensible Java CBIR Library</article-title>
          .
          <source>In Proceedings of the 16th ACM International Conference on Multimedia (MM '08)</source>
          . ACM, New York, NY, USA,
          <fpage>1085</fpage>
          -
          <lpage>1088</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Konstantin</given-names>
            <surname>Pogorelov</surname>
          </string-name>
          , Kristin Ranheim Randel, Thomas de Lange, Sigrun Losada Eskeland, Carsten Griwodz, Dag Johansen, Concetto Spampinato, Mario Taschwer, Mathias Lux, Peter Thelin Schmidt,
          <string-name>
            <given-names>Michael</given-names>
            <surname>Riegler</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Pål</given-names>
            <surname>Halvorsen</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>Nerthus: A Bowel Preparation Quality Video Dataset</article-title>
          .
          <source>In Proceedings of the 8th ACM on Multimedia Systems Conference (MMSys'17)</source>
          . ACM, New York, NY, USA,
          <fpage>170</fpage>
          -
          <lpage>174</lpage>
          . https://doi.org/10.1145/3083187.3083216
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Konstantin</given-names>
            <surname>Pogorelov</surname>
          </string-name>
          , Kristin Ranheim Randel, Carsten Griwodz, Sigrun Losada Eskeland, Thomas de Lange, Dag Johansen, Concetto Spampinato,
          <string-name>
            <surname>Duc-Tien</surname>
            Dang-Nguyen, Mathias Lux, Peter Thelin Schmidt,
            <given-names>Michael</given-names>
          </string-name>
          <string-name>
            <surname>Riegler</surname>
            , and
            <given-names>Pål</given-names>
          </string-name>
          <string-name>
            <surname>Halvorsen</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>KVASIR: A Multi-Class Image Dataset for Computer Aided Gastrointestinal Disease Detection</article-title>
          .
          <source>In Proceedings of the 8th ACM on Multimedia Systems Conference (MMSys'17)</source>
          . ACM, New York, NY, USA,
          <fpage>164</fpage>
          -
          <lpage>169</lpage>
          . https://doi.org/10.1145/3083187.3083212
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Konstantin</given-names>
            <surname>Pogorelov</surname>
          </string-name>
          , Michael Riegler, Pål Halvorsen, Thomas de Lange, Kristin Ranheim Randel,
          <string-name>
            <surname>Duc-Tien</surname>
            Dang-Nguyen,
            <given-names>Mathias</given-names>
          </string-name>
          <string-name>
            <surname>Lux</surname>
            , and
            <given-names>Olga</given-names>
          </string-name>
          <string-name>
            <surname>Ostroukhova</surname>
          </string-name>
          .
          <year>2018</year>
          .
          <article-title>Medico Multimedia Task at MediaEval 2018</article-title>
          .
          <source>In Proceedings of the MediaEval 2018 Workshop.</source>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Karen</given-names>
            <surname>Simonyan</surname>
          </string-name>
          and
          <string-name>
            <given-names>Andrew</given-names>
            <surname>Zisserman</surname>
          </string-name>
          .
          <year>2014</year>
          .
          <article-title>Very Deep Convolutional Networks for Large-Scale Image Recognition</article-title>
          .
          <source>CoRR abs/1409</source>
          .1556 (
          <year>2014</year>
          ). arXiv:
          <volume>1409</volume>
          .1556 http://arxiv.org/abs/1409.1556
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Christian</surname>
            <given-names>Szegedy</given-names>
          </string-name>
          , Sergey Io e, and
          <string-name>
            <given-names>Vincent</given-names>
            <surname>Vanhoucke</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning</article-title>
          .
          <source>CoRR abs/1602</source>
          .07261 (
          <year>2016</year>
          ). arXiv:
          <volume>1602</volume>
          .07261 http://arxiv.org/abs/1602.07261
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Christian</surname>
            <given-names>Szegedy</given-names>
          </string-name>
          , Vincent Vanhoucke, Sergey Io e, Jonathon Shlens, and
          <string-name>
            <given-names>Zbigniew</given-names>
            <surname>Wojna</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>Rethinking the Inception Architecture for Computer Vision</article-title>
          . CoRR abs/1512.00567 (
          <year>2015</year>
          ). arXiv:
          <volume>1512</volume>
          .00567 http://arxiv.org/abs/1512.00567
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>