<!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>Fool Object Detectors with L0-Norm Patch Attack</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Honglin Li*</string-name>
          <email>lihonglin@westlake.edu.cn</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yunqing Zhao</string-name>
          <email>yunqing_zhao@mymail.sutd.edu.sg</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Singapore University of Technology and Design</institution>
          ,
          <country country="SG">Singapore</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Westlake University</institution>
          ,
          <addr-line>Hangzhou, Zhejiang</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
      </contrib-group>
      <fpage>17</fpage>
      <lpage>20</lpage>
      <abstract>
        <p>Deep Neural Networks based Object Detection algorithms have shown their remarkable performance and been widely applied in various aspects in recent years. However, for those areas which draw much attention to the robustness and security of the model, like Autonomous Driving and Biomedical Image Analysis, there are still challenges to make domain users look at these detectors as reliable methods. In this paper, we mainly focus on object detection and propose our method to fool object detectors with with L0-Norm patch attack.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>CCS CONCEPTS</title>
      <p>• Computing methodologies → Object detection; • Security and
privacy;</p>
    </sec>
    <sec id="sec-2">
      <title>INTRODUCTION</title>
      <p>
        Deep Neural Networks based computer vision algorithms have
shown their remarkable performance but also faced with
vulnerability and security problems. Adversarial attack on Image
Classification has made significant progress [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], also spurred the
advancement of the robustness of the classification models [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], and
some attack research on object detection has also been made [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. To
make it deeper, CIKM-2020 and Aliyun-Tianchi host the AnalytiCup
workshop competition [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] about generating adversarial sample from
COCO [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] to attack 4 mainstream object detection models. In this
paper, we propose our solution based on Projected Gradient Descent
[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] with l0-norm towards this competition. To meet the rule of the
competition that the modified areas should be as smaller as better
and must be constructed as connected domain, we transfer such rule
into solvable problem, and make our efforts by k-means and Prim
for higher score. Eventually, we get a fine result and rank 10th out
of 1701 teams. Code has been made publicly available at our github
code repo.
      </p>
    </sec>
    <sec id="sec-3">
      <title>BACKGROUND</title>
      <p>In this section, we first make description and understanding of the
competition, then provide some background knowledge and review
the related works about adversarial attack on Object Detection.
*Corresponding author
2.1</p>
    </sec>
    <sec id="sec-4">
      <title>Competition Understanding</title>
      <p>
        The competition adopts two object detectors known by the
competitors (known as white-box attacks) and another two black-box object
detectors for evaluation. The competitors are asked to generate
adversarial examples by adding a small number of patches (less than
10) to each image (also known as L0 attacks) offline.
2.1.1 White-box Models: The 2 white-box model are the famous
Faster R-CNN [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] and YOLOv4 [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] respectively. Faster R-CNN
is known as a 2-stage detectors. The first stage, or RPN [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], will
classify a coarse fore/back-ground binary result for each anchor,
then most of the background anchors will be neglected by threshold,
and the second stage will make final prediction based on remaining
anchors. YOLOv4 is an 1-stage detector, and both of this 2
whiteboxes will predict on two aspects: the object’s bounding box size
and location, which is a regressor, and the object’s category, which
is a classifier.
2.1.2 Data, Constrains and Evaluation Metric: The
competition provides 1000 COCO test samples without annotation, where
object detectors will predict the 81 (80 types of foreground object,
and 1 for background) categories’ confidence and the bounding-box’
size and location.
      </p>
      <p>
        First limitation is the maximum limit of changed pixels rate. Second
is the maximum limit of patches’ number. The goal of the
adversaries is to make all bounding boxes failed to be returned, by adding
the patches to images. As for evaluation score, on one hand the less
bounding boxes given by the adversarial example, the higher the
score, on the other hand the less changed pixel rate, the higher the
score. More specific definition can be found in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
2.2
      </p>
    </sec>
    <sec id="sec-5">
      <title>Related Work</title>
      <p>
        A number of attacks for object detectors have been developed
recently [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] extends the attack method from classification to
detection and demonstrates that it is possible to attack objectors
using a designed classification loss. [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] generate adversarial examples
that fool detectors for stop sign and face detections. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] proposes to
attack the RPN with a specially designed hybrid loss incorporating
both classification and localization terms. Apart from the full images,
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] attack detectors by restricting the attacks to be within a local
region.
2.3
      </p>
    </sec>
    <sec id="sec-6">
      <title>Projected Gradient Descent(PGD)</title>
      <p>
        The PGD [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] attack aims at maximizing the loss: max{Jytarget , ypred }
from the viewpoint of robustness optimization. In each iteration, the
PGD first modifies x by ∇xL, then it will take projection to norm
ball.
      </p>
      <p>For some attack problems where the ground-truth label is not
given, we can propose a loss function towards bad prediction by
setting synthetic bad label, e.g. in classification problem we may set
all labels into a specific category, like 0 in MNIST. Then the original
PGD can be used by min{Jysynthetic, ypred }.
2.4</p>
      <p>
        Sparse l0-attack
In an l0-attack one is interested in finding the smallest number of
pixels which need to be changed so that the decision changes. We
show an adversarial image with l0-attack in Fig.1. From a practical
point of view the l0-attack tests basically how vulnerable the model
is to failure of pixels or large localized changes on an object e.g. a
sticker on a refrigerator or dirt/dust on a windshield [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], or stained
points on cell microscopy image.
An edge-weighted graph is a graph where we associate weights
or costs with each edge. A minimum spanning tree (MST) of an
edge-weighted graph is a spanning tree whose weight (the sum of
the weights of its edges) is no larger than the weight of any other
spanning tree.[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]
There are two mainly algorithms to solve the prblem: Prim’s
algorithm, and Kruskal’s algorithm.[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]
Jx = 1 N smlx · 1smlx&gt;τ , (1)
      </p>
      <p>N i=1
Where N is the number of predicted objects, and sml is the softmax
output, and τ is a threshold more strict than NMS threshold. 1 is
a indicator function that return 1 if smlx &gt; τ else 0. The target of
this function is trying to make all foreground prediction can not pass
NMS.
3.2</p>
    </sec>
    <sec id="sec-7">
      <title>Attacking Procedure</title>
      <p>
        Our attacking framework is summarized in Algorithm 1. Input
sample x to the given detectors, then the softmax probability of a specific
category can be obtained. Since background will be neglected by
NMS, we only store the foreground’s probability. Above input to
store process can be denoted as smlkx. By calculate the loss function,
we can make back propagation the gradient on x is got.(We just give
a simple description here about how to iterate the momentum, more
details like its cold start problem and various variants can be seen
in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].) At last, if the attack result is outside of the box, we should
projected it onto the norm bound like Fig.1.
      </p>
      <p>Algorithm 1 PGD l0-attack on ensemble of models
Input: A sample x, the foreground’s softmax function of K models:
sml1, sml2, ..., smlK and weights: w1, w2, ..., wK .</p>
      <p>Hyper-params: Training epochs T , gradient momentum update
factor µ, learning rate lr.</p>
      <p>Output: An adversarial example x∗ .</p>
      <p>x0∗ = x, momentum g0 = 0;
for t = 0 to T − 1 do</p>
      <p>Input xt∗ , get sml0xt∗ , sml1xt∗ , ..., smlK xt∗ ;
Fuse the K logits as lxt∗ = kK=1 wksmlk;
Get loss Jxt∗ based on lxt∗ and Eq.(1);
Obtain current gradient ∇xJxt∗
gt1 = gt ∗ 1 − µ ∇xJxt∗ ∗ µ
xt∗1 = xt∗ − lr ∗ gt1
update xt∗1 by projection onto l0-norm box
end for
return x∗ = xT∗
3.3</p>
    </sec>
    <sec id="sec-8">
      <title>Construct Connected Domains</title>
      <p>
        We solve the connected domains rule of this competition by K-means
and then convert sub-problem to a MST. We first set a specific pixels’
number as β for l0-attack, and train the adversarial sample with
Algorithm.1 for certain epochs. Then, we group these pixels into K
areas by K-means, which can be visualized in Fig.4. The distance
metric of two pixels is given by Chessboard Distance, or known
as Chebyshev Distance[
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. After grouping, we connect the pixels
within their group by method in 2.1.4. During connecting process,
we use these pixels’ value before l0-norm projection, and in fact this
is also a projection. If the value is same to original input, we make
slight modification on that value to keep connectivity.
4
      </p>
    </sec>
    <sec id="sec-9">
      <title>EXPERIMENTS</title>
      <p>In this section, we show our experiments based on the
methodology in section 3. In our experiments, we only attack the 2 provided
white-box models due to the computational resources limitation.
YOLOv4 make binary classification on whether the object is
foreground, and its NMS threshold (0.4) is different from Faster
RCNN(0.3). We set the threshold τ in Eq.1 as 0.15 for YOLO and
0.25 for Faster R-CNN. The latter output 81 class while the former
is binary, so the corresponding τ is relatively bigger. The value also
take the output’s unbalanced distribution into consideration.
We set our learning rate as 60000, because the attack on image’s
value are 0 − 255 while the gradients are quite small. The
momentum update factor µ = 0.5 is soft, and weights relatively high on the
gradients of current iteration compared with the usage other task,
like traditional image classification. We set the first 30 epochs to
train sample with 8000 pixels l0 limitation, then use 200 epochs to
train sample with less pixels with connecting operation, finally we
train 30 epochs to make sure the the sample quantized into uint8 type
which helps maintain most adversarial ability. The first 30 ‘pre-train’
epochs’ improvement can be visualized in Fig.5.</p>
      <p>We show our result in Table.1 by adding the methods during the
competition, the overall score list are recorded at the our subscription
result on the competition entrance. And we visualized a perturbed
image and its patch in Fig.6.
5</p>
    </sec>
    <sec id="sec-10">
      <title>DISCUSSION AND CONCLUSION</title>
      <p>In this paper, we show our PGD l0-attack adversarial solution
towards the competition’s target. We find that there is no need to make
hand-crafted patches into the image, because by PGD searching</p>
      <sec id="sec-10-1">
        <title>Module</title>
        <p>handcraft patch, A
k-means</p>
      </sec>
      <sec id="sec-10-2">
        <title>YOLO only</title>
      </sec>
      <sec id="sec-10-3">
        <title>A + YOLO</title>
        <p>momentum</p>
      </sec>
      <sec id="sec-10-4">
        <title>Prims, 1-stage A</title>
        <p>quantized training
31
683
651
997
1255
1335
61
304
783
1036
1635
2547
2836
23
51
154
357
472
546
crafted patches and only attack A, the pixels side patches will
be modified. Then we use K-means to get 10 proposal areas, and
the score gets better. We also attack YOLO only, and find that
YOLO is much easier to be destroyed. By training on ensemble
of the 2 models, we get higher black box score, even though the
white-box score shows a little decrease. By adding momentum,
the increase is promising. To lower the number of pixels, we
optimized the connecting method by Prims together with hybrid
stage-1 of A into loss function, and we get a notable
improvement. Finally, we quantize the adversarial sample after every 3
epochs, which lowers the train/test error.</p>
        <p>(a) perturbed image
(b) modified areas
of original image and perturbed image. Most of the perturbed
pixels lie near to the 3 zebra objects.
this can be done automatically. We also use K-means and Prims to
handle the game’s constrain. For l0 attack, the top-K selection is
intuitive because the amplitude of gradients on the input interpret
how important they are for the prediction target. For the reason that
the connecting process is too slow, we just connect once and keep
patches fixed, which may hinder the searching result and would be
optimized in future work.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Alexey</given-names>
            <surname>Bochkovskiy</surname>
          </string-name>
          ,
          <source>Chien Yao Wang, and Hong Yuan Mark Liao</source>
          .
          <year>2020</year>
          .
          <article-title>YOLOv4: Optimal Speed and Accuracy of Object Detection</article-title>
          . (
          <year>2020</year>
          ). https: //arxiv.org/abs/
          <year>2004</year>
          .10934
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Francesco</given-names>
            <surname>Croce</surname>
          </string-name>
          and
          <string-name>
            <given-names>Matthias</given-names>
            <surname>Hein</surname>
          </string-name>
          .
          <year>2019</year>
          .
          <article-title>Sparse and Imperceivable Adversarial Attacks</article-title>
          .
          <source>In Proceedings of the IEEE/CVF International Conference on Computer Vision</source>
          (ICCV).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Dimitar</given-names>
            <surname>Dimitrov</surname>
          </string-name>
          and
          <string-name>
            <given-names>Xiaofei</given-names>
            <surname>Zhu</surname>
          </string-name>
          .
          <year>2020</year>
          .
          <article-title>CIKM2020 Analyticup: AlibabaTsinghua Adversarial Challenge on Object Detection</article-title>
          .
          <source>Retrieved January 12</source>
          ,
          <year>2021</year>
          from https://www.cikm2020.
          <article-title>org/adversarial-challenge-on-object-detection/</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Yinpeng</given-names>
            <surname>Dong</surname>
          </string-name>
          , Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and
          <string-name>
            <given-names>Jianguo</given-names>
            <surname>Li</surname>
          </string-name>
          .
          <year>2018</year>
          .
          <article-title>Boosting Adversarial Attacks With Momentum</article-title>
          .
          <source>CVPR</source>
          (
          <year>2018</year>
          ),
          <fpage>9185</fpage>
          -
          <lpage>9193</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Diederik</given-names>
            <surname>Kingma</surname>
          </string-name>
          and
          <string-name>
            <given-names>Jimmy</given-names>
            <surname>Ba</surname>
          </string-name>
          .
          <year>2014</year>
          .
          <article-title>Adam: A Method for Stochastic Optimization</article-title>
          .
          <source>International Conference on Learning Representations (12</source>
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Yuezun</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Xian</given-names>
            <surname>Bian</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Siwei</given-names>
            <surname>Lyu</surname>
          </string-name>
          .
          <year>2018</year>
          .
          <article-title>Attacking Object Detectors via Imperceptible Patches on Background</article-title>
          . ArXiv abs/
          <year>1809</year>
          .05966 (
          <year>2018</year>
          ). http: //arxiv.org/abs/
          <year>1809</year>
          .05966
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Yuezun</given-names>
            <surname>Li</surname>
          </string-name>
          , Daniel Tian,
          <string-name>
            <surname>Ming-Ching</surname>
            <given-names>Chang</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Xiao</given-names>
            <surname>Bian</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Siwei</given-names>
            <surname>Lyu</surname>
          </string-name>
          .
          <year>2018</year>
          .
          <article-title>Robust Adversarial Perturbation on Deep Proposal-based Models</article-title>
          . CoRR abs/
          <year>1809</year>
          .05962 (
          <year>2018</year>
          ). http://arxiv.org/abs/
          <year>1809</year>
          .05962
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Tsung-Yi Lin</surname>
            ,
            <given-names>Michael</given-names>
          </string-name>
          <string-name>
            <surname>Maire</surname>
            , Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and
            <given-names>Larry</given-names>
          </string-name>
          <string-name>
            <surname>Zitnick</surname>
          </string-name>
          .
          <year>2014</year>
          .
          <string-name>
            <surname>Microsoft</surname>
            <given-names>COCO</given-names>
          </string-name>
          :
          <article-title>Common Objects in Context</article-title>
          .
          <source>In ECCV (eccv ed.). European Conference on Computer Vision</source>
          . https://www.microsoft.com/en-us/research/publication/microsoft-cococommon
          <article-title>-objects-in-context/</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Jiajun</given-names>
            <surname>Lu</surname>
          </string-name>
          , Hussein Sibai, and
          <string-name>
            <given-names>Evan</given-names>
            <surname>Fabry</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>Adversarial Examples that Fool Detectors</article-title>
          .
          <source>CoRR abs/1712</source>
          .02494 (
          <year>2017</year>
          ). http://arxiv.org/abs/1712.02494
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Aleksander</surname>
            <given-names>Madry</given-names>
          </string-name>
          , Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and
          <string-name>
            <given-names>Adrian</given-names>
            <surname>Vladu</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>Towards Deep Learning Models Resistant to Adversarial Attacks</article-title>
          . (06
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Shaoqing</surname>
            <given-names>Ren</given-names>
          </string-name>
          , Kaiming He,
          <string-name>
            <surname>Ross. Girshick</surname>
          </string-name>
          , and
          <string-name>
            <surname>Jian</surname>
          </string-name>
          . Sun.
          <year>2017</year>
          .
          <string-name>
            <surname>Faster</surname>
            <given-names>R-CNN</given-names>
          </string-name>
          :
          <article-title>Towards Real-Time Object Detection with Region Proposal Networks</article-title>
          .
          <source>IEEE Transactions on Pattern Analysis and Machine Intelligence</source>
          <volume>39</volume>
          ,
          <issue>6</issue>
          (
          <year>2017</year>
          ),
          <fpage>1137</fpage>
          -
          <lpage>1149</lpage>
          . https://doi.org/10.1109/TPAMI.
          <year>2016</year>
          .2577031
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Andrew</given-names>
            <surname>Ross</surname>
          </string-name>
          and Finale Doshi velez.
          <year>2017</year>
          .
          <article-title>Improving the Adversarial Robustness and Interpretability of Deep Neural Networks by Regularizing their Input Gradients</article-title>
          . (11
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>Robert</given-names>
            <surname>Sedgewick</surname>
          </string-name>
          and
          <string-name>
            <given-names>Kevin</given-names>
            <surname>Wayne</surname>
          </string-name>
          .
          <year>2000</year>
          .
          <article-title>Algorithms, 4th Edition</article-title>
          .
          <source>Retrieved January 12</source>
          ,
          <year>2021</year>
          from https://algs4.cs.princeton.edu/home/
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>F. Van der Heijden</surname>
          </string-name>
          , Robert Duin,
          <string-name>
            <given-names>D.</given-names>
            <surname>Ridder</surname>
          </string-name>
          , and
          <string-name>
            <given-names>David</given-names>
            <surname>Tax</surname>
          </string-name>
          .
          <year>2004</year>
          .
          <article-title>Classification, Parameter Estimation and State Estimation: An Engineering Approach Using MATLAB</article-title>
          . (01
          <year>2004</year>
          ). https://doi.org/10.1002/0470090154
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Cihang</surname>
            <given-names>Xie</given-names>
          </string-name>
          , Jianyu Wang, Zhishuai Zhang, Yuyin Zhou, Lingxi Xie, and
          <string-name>
            <given-names>Alan</given-names>
            <surname>Yuille</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>Adversarial Examples for Semantic Segmentation and Object Detection</article-title>
          .
          <source>In 2017 IEEE International Conference on Computer Vision</source>
          (ICCV).
          <volume>1378</volume>
          -
          <fpage>1387</fpage>
          . https://doi.org/10.1109/ICCV.
          <year>2017</year>
          .153
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>H.</given-names>
            <surname>Zhang</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Wang</surname>
          </string-name>
          .
          <year>2019</year>
          .
          <article-title>Towards Adversarially Robust Object Detection</article-title>
          .
          <source>In 2019 IEEE/CVF International Conference on Computer Vision</source>
          (ICCV).
          <volume>421</volume>
          -
          <fpage>430</fpage>
          . https://doi.org/10.1109/ICCV.
          <year>2019</year>
          .00051
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>