# ImageNet pretraining & Augmented reference set during inference

**URL:** <https://community.drivendata.org/t/imagenet-pretraining-augmented-reference-set-during-inference/6483>\
**Category:** Image Similarity Challenge\
**Created:** [August 26, 2021, 12:50pm UTC](https://community.drivendata.org/t/imagenet-pretraining-augmented-reference-set-during-inference/6483 "2021-08-26T12:50:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![redcurries](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@redcurries](https://community.drivendata.org/u/redcurries)\
**Post date:** [August 26, 2021, 12:50pm UTC](https://community.drivendata.org/t/imagenet-pretraining-augmented-reference-set-during-inference/6483/1 "2021-08-26T12:50:13Z")

</div>

Hi,

I will like to clarify two issues, which had been bought up in previous threads, but I will love to have clearer views on them.

1. If I have an untrained model, can I pretrain the model on ImageNet? [ImageNet](http://community.drivendata.org/t/is-it-allowed-to-train-using-imagenet-database/)

> **External data** : Pre-trained models and external data are explicitly allowed in this competition as long as the participant has a valid license for use in accordance with the Competition Rules.

1. As far as I know, we cannot use augmented images from reference set for training purpose. We can only use **unaugmented** (but crop is allowed) images from reference set for training, but it is discouraged.  
Are we allowed to perform augmentations on an image from reference set during inference into multiple augmented images, then match the augmented reference image to the query image? [Training on Reference](http://community.drivendata.org/t/training-on-reference-images/6367/)

> Augmenting reference images is permitted in the inference process of generating embeddings and matching scores, so long as each reference image is used independently without any interaction with other reference images. Use of augmented reference images for any other reason, including model training, is prohibited.

Thanks!

---

<div class="post-metadata">

**Author:** ![wenhaowang](https://avatars.discourse-cdn.com/v4/letter/w/b2d939/32.png) [@wenhaowang](https://community.drivendata.org/u/wenhaowang)\
**Post date:** [August 27, 2021, 2:47pm UTC](https://community.drivendata.org/t/imagenet-pretraining-augmented-reference-set-during-inference/6483/2 "2021-08-27T14:47:30Z")

</div>

“Augmentation (including resizing or cropping) for training purposes is only allowed on the training set, not the reference or query sets.”

---

<div class="post-metadata">

**Author:** ![glipstein](https://yyz2.discourse-cdn.com/flex028/user_avatar/community.drivendata.org/glipstein/32/920_2.png) [@glipstein](https://community.drivendata.org/u/glipstein)\
**Post date:** [August 30, 2021, 3:38pm UTC](https://community.drivendata.org/t/imagenet-pretraining-augmented-reference-set-during-inference/6483/3 "2021-08-30T15:38:30Z")

</div>

@redcurries Thanks for reaching out to clarify.

1. See language from recent response to the post.

> Participants will need to determine whether their use of a proposed external data set for the competition is permitted under the data set’s license. External data requirements are detailed in the Official Rules and any licenses need to permit use for the purposes of participating in a prize competition. Potential winners will be asked to certify that any external data they used complies with the requirements in the competition official rules.

1. As @wenhaowang mentions, you’ll want to read over the response to that thread.

> Any form of augmentation is allowed during inference. For example, you could run inference on multiple augmentations of a single image and aggregate the results for that image independently of other images.  
> Augmentation (including resizing or cropping) for training purposes is only allowed on the training set, not the reference or query sets.

---

<div class="post-metadata">

**Author:** ![coin](https://avatars.discourse-cdn.com/v4/letter/c/779978/32.png) [@coin](https://community.drivendata.org/u/coin)\
**Post date:** [September 1, 2021, 11:25am UTC](https://community.drivendata.org/t/imagenet-pretraining-augmented-reference-set-during-inference/6483/4 "2021-09-01T11:25:04Z")

</div>

Hi,

Does image channel normalization belong to augmentation?  
For example, are we allowed to divide the input image by 255, and then subtract/divide the mean/std per channel, if we want to train our models on reference images?

---

<div class="post-metadata">

**Author:** ![jayqi](https://yyz2.discourse-cdn.com/flex028/user_avatar/community.drivendata.org/jayqi/32/924_2.png) [@jayqi](https://community.drivendata.org/u/jayqi)\
**Post date:** [September 2, 2021, 3:48pm UTC](https://community.drivendata.org/t/imagenet-pretraining-augmented-reference-set-during-inference/6483/5 "2021-09-02T15:48:58Z")

</div>

Hi @coin,

A standard normalization technique like Z-scoring/standard-scaling pixel values within image channels, if applied once to an image as part of preprocessing, is not considered augmentation. In general, preprocessing techniques to normalize an image that is applied once is not considered augmentation.

From the [competition rules](https://www.drivendata.org/competitions/79/competition-image-similarity-1-dev/page/376/#datause):

> “Augmenting” images refers to applying a transformation to an image to generate a new image, such as the manner in which the query set images were derived from the reference set images.

Please refer to this [previous answer](http://community.drivendata.org/t/training-on-reference-images/6367/10) for more general clarification about when augmentation is allowed or not.
