Automatic Check-Out via Prototype-Based Classifier Learning from Single-Product Exemplars
- Publication
- ECCV 2022Conference
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@inproceedings{retailproductpsp2022,
title = {{Automatic Check-Out via Prototype-Based Classifier Learning from Single-Product Exemplars}},
author = {Hao Chen and Xiu-Shen Wei and Faen Zhang and Yang Shen and Hui Xu and Liang Xiao},
year = {2022},
booktitle = {ECCV},
url = {https://doi.org/10.1007/978-3-031-19806-9_16},
doi = {10.1007/978-3-031-19806-9_16}
}
When the RPC dataset first came out, it spelled out clearly what makes automatic checkout hard.
The training data are single-product images: each product sits on a turntable and is photographed all the way round from four directions against a clean background. The test data are checkout images: a dozen or so products piled on a white counter, shot from directly above, occluding one another. The two hardly look like the same problem.
For the next two years, the mainstream answer was synthesis. Cut the products out of the single-product images, paste them at random onto an empty counter to fake checkout images, then use CycleGAN to make the lighting of the fakes look more real. The RPC baseline, DPNet and IncreACO all took this route, and training one detector took 100,000 synthetic images plus 100,000 rendered ones.
This paper comes from Nanjing University of Science and Technology and AInnovation; author Xiu-Shen Wei's team has worked on fine-grained recognition for a long time. They take a different direction. Instead of making fake images, they use the single-product images directly to compute a "representative" for each product class, and use that representative as the classifier.
Problem Definition

The question automatic checkout has to answer is how many of each product are in a checkout image. The authors list three difficulties: many classes, a large domain gap between training and test, and many products that are fine-grained subclasses of the same broad category, such as different flavors of the same brand of potato chips.
PSP stands for Prototype-based classifier learning from Single-Product exemplars, that is, learning prototype classifiers from single-product images.
Solution

The overall skeleton is a standard two-stage detector, Faster R-CNN with FPN. The difference lies in the second-stage classifier. An ordinary detector uses a fully connected layer that learns a fixed set of weights to classify each proposal; PSP computes its classification weights from the single-product images.
Computing Prototypes from Single-Product Images
For each product class, take 8 single-product images, extract features with a pretrained ResNet-50, apply global max pooling and average the results. That average is the class prototype:
The prototype then passes through a two-layer MLP (the generator) and becomes the class's classifier weights . The inner product of a proposal feature with every classifier gives its score for each class.
The 8 images aren't picked at random. At a single turntable angle, the authors take the 8 shots of the product's front and back from each of the four cameras. They also tried 1, 4, 80 and all of the images, and 8 came out best (86.69%); 1 image gave 85.21%, and using all of them 86.40%. Averaging lets the prototype fuse several views into one representative, which is more stable than any single view.
The Background Needs a Representative Too
Many proposals aren't products at all. They cover only the counter, or only half a product, and the detector needs a "background" class to reject them.
The authors average the prototypes of all classes to get a background prototype, which goes through the same generator to become the background classifier:
At first glance this design is a little counter-intuitive. The background isn't any product, so why use the average of all the products? The authors' reasoning is that this "average product" resembles every product a little, yet doesn't look like any particular one.
Discriminative Re-ranking
That also explains the next design. For a proposal that frames a product, the authors require the correct class to score highest, background second, and every other class lower.
Why should background come second? Because the background classifier is the average of all classes, its inner product with any product box ought to be higher than those of unrelated classes. If the model learns this ordering, then at test time a box whose top score is background can be judged a false positive and thrown away.
But the products are fine-grained. Original and barbecue-flavored chips from the same brand look almost identical, and requiring the barbecue score to fall below background is too strict. The authors add a slack variable to make it a soft re-ranking: similar classes whose scores exceed 97% of the top score may rank above background. The re-ranking is written as a hinge-style loss and added to training.
Co-occurrence
Finally, there's a multi-label loss. The features of the whole checkout image go through global average pooling and global max pooling, the two are summed, and a fully connected layer predicts which classes appear in the image. The authors hope this lets the model learn which products are often bought together. The total loss is the equal-weight sum of the detection, re-ranking and multi-label terms.
Discussion
Different Training Data
Before reading the results, there's an experimental detail to check.
PSP's classifier prototypes come from single-product images, but the whole detector is trained on 6,000 checkout images from the RPC validation set and tested on another 24,000 checkout images. The three comparison methods in the table, by contrast, are trained only on synthetic and rendered fake checkout images, 200,000 in all, without the annotations of a single real checkout image.
These two settings solve different problems. The first asks "with a batch of labeled real checkout images in hand, how do you use single-product images to do better?" The second asks "with no labeled checkout images at all, how do you start from single-product images?" The paper's comparison table puts them side by side without pointing this out.
Main Results
| Method | Training data | cAcc | ACD | mCIoU |
|---|---|---|---|---|
| Wei et al. (RPC baseline) | Synthetic + rendered | 56.68% | 0.89 | 93.19% |
| IncreACO | Synthetic + rendered | 77.15% | 0.41 | 96.72% |
| DPNet | Synthetic + rendered | 80.51% | 0.34 | 97.33% |
| PSP (Faster R-CNN) | 6,000 real images | 86.69% | 0.19 | 98.44% |
| PSP (Cascade R-CNN) | 6,000 real images | 92.05% | 0.13 | 98.98% |
Source: Table 1 of the paper, averaged clutter level. The training-data column follows Sections 4.1 and 4.3 of the paper.
cAcc is the fraction of checkout images in which every product count is right. One miscounted item makes the whole image wrong, so it's the strictest metric.
PSP's Faster R-CNN version reaches 86.69%, 6.18 above DPNet; with Cascade R-CNN it's 92.05%. The more products and the more clutter, the bigger the gap. In the most crowded hard mode, DPNet scores 70.76% and PSP 80.67%.
There is, however, a number from the same line of work that didn't make it into the table. DPSNet, covered on this site, also builds on a Faster R-CNN-type detector and trains only on rendered images and pseudo-labels; its average cAcc is already 86.54%, and 88.14% with instance-level samples. PSP's Faster R-CNN version, at 86.69%, is only 0.15 higher.
Ablation
| Setting | cAcc |
|---|---|
| Plain fully connected classifier | 82.87% |
| Single-product prototype classifier | 85.12% |
| + Soft re-ranking | 85.93% |
| + Multi-label loss | 86.69% |
Source: Table 2 of the paper, excerpt.
The first row of this table matters a lot. Trained on the same 6,000 real checkout images, with the most ordinary fully connected classifier in the detector's second stage, cAcc is already 82.87%, higher than every older method in Table 1. In other words, of PSP's 6.18-point lead over DPNet, about 2.4 points come from the setting itself, training directly on real checkout images, and only the remaining 3.8 or so are the combined contribution of the three designs: prototypes, re-ranking and multi-label.
Individually, the prototypes contribute +2.25, soft re-ranking +0.81 and multi-label +0.76. Soft re-ranking beats hard re-ranking by 0.79, so letting fine-grained look-alike classes rank above background does help.
The authors also compared where the prototypes come from. Computing them from real product boxes in checkout images instead of from single-product images gives 85.65% for the full version, 1.04 below the 86.69% of the single-product version. The authors take this to show that prototypes from single-product images represent their classes better and bridge the domain gap better.
Code
The code is on GitHub, a modification of MMDetection 2.14; you have to copy the authors' files over a stock MMDetection. The repo has 3 issues, none of them answered.
Conclusion
PSP's core idea is very clean. Each product class takes 8 single-product images from different views and averages them into a prototype, and a small network turns the prototype into a classifier; the background is the average of all the prototypes. Re-ranking keeps the background score in second place, so at test time it can filter out false positives. The ablation shows these three designs adding 3.8 points together.
The comparison table, though, has to be read against the experimental conditions. PSP uses 6,000 labeled real checkout images, while the methods it is compared with use synthetic data only; under PSP's conditions, a plain classifier already reaches 82.87%. On the cross-domain problem RPC originally posed, going from single-product images to checkout images, PSP and the previous year's DPSNet are practically tied.
If a store already has a batch of labeled real checkout images, PSP shows how to bring the single-product information in on top of them, and the prototypes need only 8 single-product images per class. If you don't have a single real checkout image yet, this paper's numbers won't help much.