Bias-based Universal Adversarial Patch Attack for Automatic Check-out
- Publication
- ECCV 2020Conference
- First submitted to arXiv
- arXiv:2005.09257
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{retailproductacoadversarialpatch2020,
title = {{Bias-based Universal Adversarial Patch Attack for Automatic Check-out}},
author = {Aishan Liu and Jiakai Wang and Xianglong Liu and Bowen Cao and Chongzhi Zhang and Hang Yu},
year = {2020},
eprint = {2005.09257},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2005.09257}
}
The idea of automatic checkout (Automatic Check-Out, ACO) is that a customer sets the shopping basket down on the checkout counter, a camera takes a picture, and the system recognizes how many bottles of drinks and packs of cookies are inside and charges for them directly, with no clerk scanning barcodes item by item.
Supermarket products already carry all sorts of stickers, from price tags and promotional stickers to the little origin stickers on fruit, and nobody gives them a second glance.
What happens if someone sticks a carefully designed sticker on a product so that the checkout system takes it for something else?
This paper, from Beihang University, studies exactly that question. What the authors want is a "universal" adversarial patch, one sticker that works on any product, including products never seen in training.
Problem Definition
A bit of background first. An adversarial example adds a small perturbation to the input, invisible to the human eye, that makes a neural network get it wrong. Such perturbations usually cover the whole image and are hard to realize in the physical world; you can't add a little noise to every pixel of a carton of milk.
An adversarial patch takes a different route, concentrating the perturbation in a small region that you just print out and stick on. As a formula, a mask decides where the patch goes, and that part of the original image is replaced with the patch :
Several patch attacks already existed at the time, such as AdvPatch, RP2 and PSGAN. The authors see their weakness as poor generalization: a trained patch works on some classes but not on others, and does even worse on classes not seen in training.
What the authors want is a "universal" patch, for which holds for almost every input .
Solution

The method has two stages, each exploiting one of two "biases" of the model. The first stage decides what the patch looks like at the start; the second decides what data to train it on.
Stage One: Growing the Initial Patch from Hard Examples
The authors' starting point is a known phenomenon, that CNNs lean heavily on texture when they make decisions. Cut an image into small pieces and shuffle them, and as long as the local textures survive, the model often still recognizes it.
So the patch's initial look should ideally be a texture that "makes the model hesitate". The authors go looking for hard examples, meaning images the model misclassifies, or classifies correctly but with low confidence. These images already sit near the decision boundary.
They picked 200 hard examples from different classes and optimized a fused image that carries the textures of all of them at once. The tool for measuring texture similarity is the Gram matrix familiar from style transfer:
holds the pairwise inner products between the channels of a feature map at some layer; it records "which texture features tend to occur together", regardless of where in the image they occur.
An uncertainty loss is added as well, minimizing the negative entropy of the model's predicted distribution on the fused image; in other words, when the model sees this image, it can't make up its mind about any class. The two terms together form the fusion loss .
The fused image isn't the same size as the patch. Using something like Grad-CAM, the authors compute which locations in the fused image influence the model's prediction most, and take the highest-weighted region as the patch's initial value .
Stage Two: Prototypes Instead of Real Photos
Universal perturbations usually need a lot of training data to cover all kinds of classes. The authors' second idea is to skip real photos and use what each class looks like "in the model's own mind".
The procedure starts from an image and keeps adjusting its pixels until the logit of the target class beats every other class by a margin:
is the logit of class , is the total number of classes, and is that margin, set to 10. An image optimized this way is called a class prototype; it looks like a blob of abstract texture carrying the class's features (the stack of colorful images in the middle of Fig. 2).
Next, the patch is pasted onto the prototypes and optimized so that the model's probability for the original class falls as far as possible below the highest probability among the other classes:
is a prototype with the patch pasted on. On a real checkout counter, products turn, tilt and catch different light, so training also applies random rotation (within ±30 degrees), distortion and affine transformations to the patch, and takes the expectation over these transformations.
Discussion
First, What Is Being Attacked
The experiments use the RPC dataset, with 200 product classes. It's worth pausing here to get the setup straight, because it's some distance from the "automatic checkout" in the title.
RPC has two kinds of images. One kind is single-product images, each product on a turntable shot from four directions; the other is checkout images, a pile of products on a checkout counter, used to test the full counting system. The target model in this paper is a ResNet-152 classifier trained following the setup of the earlier DPNet, and what gets attacked is the classification of single-product images. The metrics are top-1, top-3 and top-5 classification accuracy.
In other words, there's no detection here, no counting and no checkout list; what's measured is "whether the classifier still recognizes a product once a sticker is on it". That's one link in a checkout system, not the full system.
Inputs are resized to 512×512 and the patch is 32×32, just 0.38% of the image. The compared methods are trained on 50 real photos per class, 10,000 in total; the authors' method uses 15 prototypes per class, 3,000 in total.
White-Box Attack

Start with the leftmost group. With a white square pasted on, top-1 is 79.54%, roughly this classifier's normal level on single-product images.
With this paper's patch, top-1 falls to 5.42%; AdvPatch and PSGAN are a little over 19%, and RP2 is at 38.89%. On top-1 alone, the gap is obvious.
But look at the top-3 and top-5 bars. The method's top-5 is 58.91%, about the same as PSGAN's 59.46%, and higher than AdvPatch's 53.94%. The patch is very good at knocking the right answer out of first place, but for nearly 60% of the products, the right answer is still in the top five.
The training curves on the right show a difference too. The proposed method settles within a few epochs; PSGAN oscillates all the way through, which the authors read as a sign of poor generalization, with the attack's effect swinging widely from class to class.
Black Box and Unseen Classes
The black-box attack generates the patch on ResNet-152 and uses it against other models whose architecture and parameters are unknown (top-1; lower means a more successful attack):
| Target model | AdvPatch | RP2 | PSGAN | Ours |
|---|---|---|---|---|
| VGG-16 | 73.82 | 81.25 | 74.69 | 73.72 |
| AlexNet | 51.11 | 68.27 | 49.39 | 31.68 |
| ResNet-101 | 56.19 | 73.52 | 51.26 | 22.24 |
Source: Table 1 of the paper, top-1 accuracy.
Transfer works best on ResNet-101, from the same family, bringing it down to 22%; on VGG-16 it barely works, with all four methods above 70%, not much different from no attack at all.
The generalization experiment trains the patch on only 100 classes and then attacks all 200. The proposed method brings top-1 down to 7.23%, while the other three methods land between 31.62% and 60.87%. This is the widest gap in the paper, and the most direct support for the "universal" claim.
Print It, Stick It On
To check the real-world effect, the authors tested against the photo search of Taobao and JD. Four products were each shot in a round of photos at different angles and distances, from −30 to 30 degrees and 0.3 to 1 meter, for 80 photos in total. Clean photos get 100% top-1 on Taobao and 95% on JD.
The patches were printed on an HP laser printer, stuck on the products, and photographed with a Canon camera. Taobao drops to 56.25% and JD to 55.00%.

It looks alarming, but a few things have to be weighed together.
Taobao's and JD's photo search aren't checkout systems; they're e-commerce search-by-image, and their models have nothing to do with the ResNet-152 trained on RPC. So this experiment tests two things at once: whether the patch keeps working after printing and photographing, and whether it transfers to a completely different black-box system.
Both held up about halfway. Accuracy falling from nearly 100% to just over 50% shows the patch does have an effect, and also that half of the photos are still recognized as usual. The sample is four products and 80 photos, which isn't much.
The authors also picked 4 products outside RPC's 200 classes and took 64 photos; top-1 on Taobao was 65.63%.
Ablations
The initial value matters a lot. With the same training procedure and only the initial patch changed, top-1 after the attack is 17.67% for white, 18.96% for Gaussian noise, 16.11% for a single hard example and 24.09% for a fusion of easy examples, against 5.42% for the paper's fused hard-example prior.
There's a detail hidden in these numbers. Training from a white square already gets 17.67%, better than AdvPatch's 19.67%. So part of the framework's advantage comes from the prototype training and the transformation module, and not all the credit goes to the prior.
The prototypes really do save data. A patch trained on 1,000 prototypes gets a top-1 of 6.51%; with real photos, 1,000 only get it to 12.43%, and it takes 2,000 to reach 6.57%. With the total fixed at 1,000 images, the higher the share of prototypes, the stronger the attack.
Adding transformations during training also helps. Distortion matters most, with a top-1 of 22.26% with it versus 30.70% without.
Conclusion
This paper brings adversarial patches into the retail setting. Both designs have evidence behind them. The texture prior fused from multiple hard examples starts the patch close to the decision boundary; replacing real photos with class prototypes generated by the model itself trains an equally strong universal patch on half the data. The 7.23% from training on half the classes and attacking all of them is the most convincing number in the paper.
When reading it, keep in mind what it measures. The target is a classifier of single-product images, not a full checkout pipeline that counts out a list from a tray of products; the physical experiments hit e-commerce photo search, and accuracy fell to about half. The right answer often stays in the top five, which is fatal for a system that only takes first place; if the system consults a candidate list, or has a weight sensor as well, the impact may be much smaller.
The paper's code isn't public, so the details of the attack have to be pieced together from the text. What it points out holds without any reproduction, though. For a self-checkout camera, that promotional sticker on a product that nobody pays any attention to is part of the input too.