Skip to content

liyiersan/cig_rec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Official implementation of paper "Region-Aware Metric Learning for Few-Shot Recognition of Counterfeit Cigarettes from Packaging Images"

1. Environment

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.1

2. How to train/test

python main.py --cfgs ./configs/base.yaml --phase train
python main.py --cfgs ./configs/base.yaml --phase test

You may need to change the configs/base.yaml according to your dataset.

3. Dataset Preparation

Data should be organized as follows:

brand_name/
├── train/
│   ├── region0/
│   │   ├── real/
│   │   │   ├── img1
│   │   │   └── img2
│   │   └── fake/
│   └── region1/
└── test/

img

4. Inference

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.py

For the test samples, they are available at:

Baidu Netdisk, code: feap

Google Drive

For the model weights, they are available at:

Baidu Netdisk, code: msh5

Google Drive

5. Data availability

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.

6. Context-aware saliency detection

Please refer to https://github.com/MCG-NKU/SalBenchmark/tree/master/Code/matlab/CA

7. Cite

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}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages