[go: nahoru, domu]

Skip to content

Source code for Shopee Code League - Product Detection Challenge (Rank 4 in Private, Rank 6 in Public)

License

Notifications You must be signed in to change notification settings

nutcrtnk/Product-detection-Shopee-CL-2020-

Repository files navigation

Product Detection (Shopee Code League 2020)

Source code for Shopee Code League - Product Detection Challenge (Rank 4 in Private, Rank 6 in Public under a team named "Citebok") (Kaggle Link).

Motivation

The task was to identify the class of the product based on provided train data with labels (supervised).

To solve the problem, we tried:

  1. multiple publicly available pretrain models in torchvision.models and Efficient Nets (Tan and Le. ICML 2019) (in model.py).
  2. several loss functions (in losses.py)
  3. several image augmentation techniques (in data.py, randaug.py)
  4. contrastive learning in self-supervised manner (Khosla et al. NeurIPS 2020, Chen et al. ICML 2020) (in train_con.py)
  5. transfer learning regularization and freezing (in train.py)
  6. fixing train-test resolution discrepancy (Touvron et al. NeurIPS 2019).

Usage

To run:

  1. Prepare dataset in label/image_file structure.
  2. Set correct paths in config.py.
  3. Use split.py to leave some train data for validation purpose.
  4. (optionally, run train_con.py) Run train.py for finetuning pretrained model in supervised manner. See arguments/options inside the file.
  5. Run test.py to obtain the test labels.

To run the code with the best performance setting, see run.sh.

Results

We achieved the best performance with EffNet B5 with fixing resolution 456->600.

In the experiments, we found that:

  1. Using a good pretrained model pretrained on high-resolution images, e.g., EffNet B5-B7, could improve the performance significantly, compared to other modifications.
  2. Cross entropy achieved the best performance among loss functions. Some losses could drastically decrease the performance.
  3. Using augmentation technique had very little effect to the performance (less than 2%)
  4. Contrastive learning provided small increase in performance, but took much longer time for training.
  5. Transfer learning regularization and freezing yielded no improvement.
  6. Simply fixing train-test resolution discrepancy could impressively increase up to 5% performance.

Team members

Nuttapong Chairatanakul, Nontawat Charoenphakdee, Pannavat Terdchanakul, Zhenghang (Henry) Cui

About

Source code for Shopee Code League - Product Detection Challenge (Rank 4 in Private, Rank 6 in Public)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published