<!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>MULTI-PLATEAU ENSEMBLE FOR ENDOSCOPIC ARTEFACT SEGMENTATION AND DETECTION Suyog Jadhav, Udbhav Bamba, Arnav Chavan, Rishabh Tiwari, Aryan Raj Indian Institute of Technology (ISM), Dhanbad</article-title>
      </title-group>
      <abstract>
        <p>Endoscopic artefact detection challenge consists of 1) Artefact detection, 2) Semantic segmentation, and 3) Out-ofsample generalisation. For Semantic segmentation task, we propose a multi-plateau ensemble of FPN[1] (Feature Pyramid Network) with EfficientNet[2] as feature extractor/encoder. For Object detection task, we used a three model ensemble of RetinaNet[3] with Resnet50[4] Backbone and FasterRCNN[5] (FPN + DC5[6]) with Resnext101 Backbone[7, 8]. A PyTorch implementation to our approach to the problem is available at github.com/ubamba98/EAD2020. Index Terms- Endoscopy, FPN, EfficientNet, RetinaNet, Faster RCNN, Artefact detection.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. DATASETS</title>
      <p>
        The given dataset of EndoCV-2020 [
        <xref ref-type="bibr" rid="ref5 ref6 ref7">9, 10, 11</xref>
        ] has a total of
643 images for the segmentation task which we divided into
three parts - train (474 images), validation (99 images) and
holdout (70 images) in the sequence they were released. We
made sure that the distribution of train and holdout were
similar and that of validation was different. Validation set ensured
that the model was not overfitting to the training data and at
the same time generalizing well on holdout. For Detection, a
similar strategy was adopted - train (2200 images), validation
(232 images) and holdout (99 images)
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. METHODS</title>
    </sec>
    <sec id="sec-3">
      <title>2.1. Data Pre-processing and Augmentations</title>
      <p>Due to the variable aspect ratios and sizes in the training
data, we adopted a stage-dependent rescaling policy.
During the training stage, we cropped the images to a fixed size
of 512x512 without resizing. This made sure that the
spatial information was not lost and at the same time, the
input to models was within trainable limits. During validation
and testing time, we padded the images such that both
dimensions are a multiple of 128 which is required for the
EfficientNet backbone (to handle max-pooling in deeper models). As</p>
      <p>
        Copyright c 2020 for this paper by its authors. Use permitted under
Creative Commons License Attribution 4.0 International (CC BY 4.0).
the number of samples in the dataset were relatively low and
unbalanced, various augmentation techniques were adopted
to prevent overfitting and achieve generalization. Horizontal
and vertical flip, cutout (random holes)[
        <xref ref-type="bibr" rid="ref8">12</xref>
        ], random contrast,
gamma, brightness, rotation were tested out. To strongly
regularize the data we propose the use of CutMix for
segmentation (Algorithm: 1) which was toggled on and off depending
upon the variance of model outputs.
      </p>
      <p>Algorithm 1 CutMix for Segmentation
for each iteration do
input, target = get minibatch(dataset)
if mode == training then
input s, target s = shuffle minibatch(input, target)
lambda = Unif(0,1)
r x = Unif(0,W)
r y = Unif(0,H)
r w = Sqrt(1 - lambda)
r h = Sqrt(1 - lambda)
x1 = Round(Clip(r x - r w / 2, min=0))
x2 = Round(Clip(r x + r w / 2, max=W))
y1 = Round(Clip(r y - r h / 2, min=0))
y2 = Round(Clip(r y + r h / 2, min=H))
input[:, :, x1:x2, y1:y2] = input s[:, :, x1:x2, y1:y2]
target[:, :, x1:x2, y1:y2] = target s[:, :, x1:x2, y1:y2]
end if
output = model forward(input)
loss = compute loss(output, target)
model update()
end for</p>
      <p>For Object detection spatial transformations - flip and
random scaling and rotating were used.</p>
    </sec>
    <sec id="sec-4">
      <title>2.2. Multi-Plateau Approach</title>
      <p>
        Due to high variability and early overfitting nature in the
dataset, the main focus was on making a strong ensemble by
training models on different optimisation plateaus. A total
of 8 different plateaus with permutations of two different
optimisers and four different loss functions were optimised
with EfficientNet backbone increasing the depth, width and
resolution three times, going from B3 to B5 (Table 1). For
optimisers, Ranger and Over9000 were used. Ranger is a
synergistic optimiser combining RAdam (rectified Adam)[
        <xref ref-type="bibr" rid="ref9">13</xref>
        ]
and LookAhead[
        <xref ref-type="bibr" rid="ref10">14</xref>
        ], and Over9000 is a combination of
Ralamb[
        <xref ref-type="bibr" rid="ref11">15</xref>
        ] and LookAhead. A total of 2*4*3 = 24 models
were trained, but in the final ensemble, only the models with
a dice greater than 0.47 were considered. Average pixel-wise
ensembling was adopted.
      </p>
    </sec>
    <sec id="sec-5">
      <title>2.3. Multi Stage Training</title>
      <p>Complete segmentation training pipeline was divided into
four stages
Stage 1 - CutMix was disabled to reduce regularization effect,
encoder was loaded with ImageNet weights and freezed for
the decoder to learn spatial features without being stuck into
saddle point, crops were taken with at least one pixel having
a positive mask.</p>
      <p>Stage 2 - CutMix was enabled for strong regularization, and
encoder was unfreezed to learn spatial features of endoscopic
images.</p>
      <p>Stage 3 - Random crops were trained instead of non-empty
crops for the model to learn negative samples.</p>
      <p>Stage 4 - Very few epochs with CutMix disabled and encoder
freezed for generalization on original data.</p>
      <p>For every consecutive stage best checkpoint of the previous
stage was loaded.</p>
    </sec>
    <sec id="sec-6">
      <title>2.4. Triple Threshold</title>
      <p>After analysing predictions on holdout, it was found that the
number of false positives was quite high. To counter this, we
implemented a novel post-processing algorithm which
specifically reduced the number of false positives in the predictions
(Algorithm 2). Three sets of thresholds - max prob thresh,
min prob thresh, min area thresh were tuned for this given
task.</p>
      <p>max prob thresh and min prob thresh were tuned using
grid search on holdout dataset, whereas min area thresh was
calculated by sorting sum of positive pixels of every class and
taking the 2:5th percent respectively. min area thresh used
after calculation were 2000, 128, 256, 256 and 1024
respectively for every class. The results for triple threshold on
single best model are compiled in Table 3 and comparison of our
best performing models in Table 4.</p>
    </sec>
    <sec id="sec-7">
      <title>Parameter</title>
      <p>iou thresh
score thresh
weights</p>
      <p>Algorithm 2 Triple Threshold
for each sample do
output masks = model(each sample)
final masks = []
i = 0
for each output mask in output masks do
max mask = output mask &gt; max prob thresh
if max mask.sum() &lt; min area thresh[i] then
output mask = zeros(output mask.shape)
else</p>
      <p>output mask = output mask &gt; min prob thresh
end if
i = i + 1
final masks.append(output mask)
end for
end for</p>
    </sec>
    <sec id="sec-8">
      <title>2.5. Object Detection</title>
      <p>For Object Detection, individual models were trained with
SGD as optimizer and confidence threshold of 0.5. To counter
the variance and improve the performance of our model
predictions, general ensembling was performed. Retinanet with
backbones of FPN and Resnet50 and Faster RCNN with
backbones of FPN and Resnext 101 32xd were trained (Table 5).
Our ensemble strategy involves finding overlapping boxes of
the same class and average their positions while adding their
confidences. For finding the best parameters for ensembling
the three models predictions, we ran a grid search with all
possible combinations of the given range of values (Table 2).</p>
    </sec>
    <sec id="sec-9">
      <title>3. RESULTS</title>
      <p>We achieved a Segmentation score which was a weighted
linear combination of dice, IOU and F2 of 0.5675 on the final
leader board and for object detection task, an mAP of 0.2061
was obtained.</p>
    </sec>
    <sec id="sec-10">
      <title>4. DISCUSSION &amp; CONCLUSION</title>
      <p>Gastric cancer accounts for around 1 million deaths each year
which can be prevented by early diagnosis. In this paper we
explored multi-plateau ensemble to generalize pixel level
segmentation and localization of artefacts in endoscopic images.
We developed novel augmentation and post-processing
algorithms for better and robust model convergence.</p>
    </sec>
    <sec id="sec-11">
      <title>5. REFERENCES</title>
      <p>[2] Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking
model scaling for convolutional neural networks, 2019.
[3] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He,
and Piotr Dollr. Focal loss for dense object detection,
2017.
[4] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian
Sun. Deep residual learning for image recognition,
2015.
Seiryo Watanabe, Ilkay Oksuz, Qingtian Ning,
Shufan Yang, Mohammad Azam Khan, Xiaohong W. Gao,
Stefano Realdon, Maxim Loshchenov, Julia A.
Schnabel, James E. East, Geroges Wagnieres, Victor B.
Loschenov, Enrico Grisan, Christian Daul, Walter
Blondel, and Jens Rittscher. An objective comparison of
detection and segmentation algorithms for artefacts in
clinical endoscopy. Scientific Reports, 10, 2020.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Shaoqing</given-names>
            <surname>Ren</surname>
          </string-name>
          , Kaiming He,
          <string-name>
            <surname>Ross Girshick</surname>
            , and
            <given-names>Jian</given-names>
          </string-name>
          <string-name>
            <surname>Sun</surname>
          </string-name>
          .
          <article-title>Faster r-cnn: Towards real-time object detection with region proposal networks</article-title>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Jifeng</given-names>
            <surname>Dai</surname>
          </string-name>
          , Haozhi Qi, Yuwen Xiong,
          <string-name>
            <given-names>Yi</given-names>
            <surname>Li</surname>
          </string-name>
          , Guodong Zhang, Han Hu, and
          <string-name>
            <given-names>Yichen</given-names>
            <surname>Wei</surname>
          </string-name>
          .
          <source>Deformable convolutional networks</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Saining</given-names>
            <surname>Xie</surname>
          </string-name>
          , Ross Girshick, Piotr Dollr, Zhuowen Tu, and
          <string-name>
            <given-names>Kaiming</given-names>
            <surname>He</surname>
          </string-name>
          .
          <article-title>Aggregated residual transformations for deep neural networks</article-title>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Jie</given-names>
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Li</given-names>
            <surname>Shen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Samuel</given-names>
            <surname>Albanie</surname>
          </string-name>
          , Gang Sun, and
          <string-name>
            <given-names>Enhua</given-names>
            <surname>Wu</surname>
          </string-name>
          .
          <article-title>Squeeze-and-excitation networks</article-title>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Sharib</given-names>
            <surname>Ali</surname>
          </string-name>
          ,
          <string-name>
            <surname>Felix Zhou</surname>
            , Christian Daul, Barbara Braden, Adam Bailey, Stefano Realdon, James East, Georges Wagnieres, Victor Loschenov,
            <given-names>Enrico</given-names>
          </string-name>
          <string-name>
            <surname>Grisan</surname>
          </string-name>
          , et al.
          <article-title>Endoscopy artifact detection (ead 2019) challenge dataset</article-title>
          .
          <source>arXiv preprint arXiv:1905.03209</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Sharib</surname>
            <given-names>Ali</given-names>
          </string-name>
          , Felix Zhou, Adam Bailey, Barbara Braden, James East, Xin Lu, and
          <string-name>
            <given-names>Jens</given-names>
            <surname>Rittscher</surname>
          </string-name>
          .
          <article-title>A deep learning framework for quality assessment and restoration in video endoscopy</article-title>
          .
          <source>arXiv preprint arXiv:1904.07073</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Sharib</surname>
            <given-names>Ali</given-names>
          </string-name>
          , Felix Zhou, Barbara Braden, Adam Bailey, Suhui Yang, Guanju Cheng, Pengyi Zhang, Xiaoqiong Li,
          <string-name>
            <given-names>Maxime</given-names>
            <surname>Kayser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Roger D.</given-names>
            <surname>Soberanis-Mukul</surname>
          </string-name>
          , Shadi Albarqouni, Xiaokang Wang, Chunqing Wang,
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Terrance</surname>
            <given-names>DeVries</given-names>
          </string-name>
          and Graham W. Taylor.
          <article-title>Improved regularization of convolutional neural networks with cutout</article-title>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Liyuan</surname>
            <given-names>Liu</given-names>
          </string-name>
          , Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu,
          <string-name>
            <given-names>Jianfeng</given-names>
            <surname>Gao</surname>
          </string-name>
          , and Jiawei Han.
          <article-title>On the variance of the adaptive learning rate and beyond,</article-title>
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Michael</surname>
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Zhang</surname>
            , James Lucas,
            <given-names>Geoffrey</given-names>
          </string-name>
          <string-name>
            <surname>Hinton</surname>
            , and
            <given-names>Jimmy</given-names>
          </string-name>
          <string-name>
            <surname>Ba</surname>
          </string-name>
          .
          <article-title>Lookahead optimizer: k steps forward, 1 step back</article-title>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Yang</surname>
            <given-names>You</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Igor Gitman</surname>
            , and
            <given-names>Boris</given-names>
          </string-name>
          <string-name>
            <surname>Ginsburg</surname>
          </string-name>
          .
          <article-title>Large batch training of convolutional networks</article-title>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>