Official implementation of paper "Region-Aware Metric Learning for Few-Shot Recognition of Counterfeit Cigarettes from Packaging Images"
matplotlib==3.6.2
opencv-python==4.9.0.80
Pillow==9.3.0
PyYAML==6.0.1
scikit-learn==1.4.1.post1
torch==1.13.1python main.py --cfgs ./configs/base.yaml --phase train
python main.py --cfgs ./configs/base.yaml --phase testYou may need to change the configs/base.yaml according to your dataset.
Data should be organized as follows:
brand_name/
├── train/
│ ├── region0/
│ │ ├── real/
│ │ │ ├── img1
│ │ │ └── img2
│ │ └── fake/
│ └── region1/
└── test/We release some test samples of 1916_scan and 1916_camera, as well as the model weights. You can try it as follows:
python inference.pyFor the test samples, they are available at:
For the model weights, they are available at:
To safeguard against counterfeiters using our dataset to improve their forgery methods, we will not disclose the collected cigarette data or the anti-counterfeiting regions linked to each cigarette specification. For legitimate inquiries, please contact zhouqian@whu.edu.cn and enter into a confidentiality agreement.
Please refer to https://github.com/MCG-NKU/SalBenchmark/tree/master/Code/matlab/CA
If you find the repo useful to your work, please cite our paper.
@article{zhou2025region,
title={Region-Aware Metric Learning for Few-Shot Detection of Counterfeit Cigarettes from Packaging Images},
author={Zhou, Qian and Ding, Huanrou and Li, Chengzhe and Zou, Hua and Zhang, Chao and Zhang, Ting},
journal={Expert Systems with Applications},
pages={129456},
year={2025},
publisher={Elsevier}
}