Home

Awesome

Improving Generalization via Scalable Neighborhood Component Analysis

This repo constains the pytorch implementation for the ECCV 2018 paper (paper). We use deep networks to learn feature representations optimized for nearest neighbor classifiers, which could generalize better for new object categories. This project is a re-investigation of Neighborhood Component Analysis (NCA) with recent technologies to make it scalable to deep networks and large-scale datasets.

Much of code is extended from the previous unsupervised learning project. Please refer to this repo for more details.

<img src="http://zhirongw.westus2.cloudapp.azure.com/figs/snca.png" width="800px"/>

Pretrained Models

Currently, we provide three pretrained ResNet models. Each release contains the feature representation of all ImageNet training images (600 mb) and model weights (100-200mb). Models and their performance with nearest neighbor classifiers are as follows.

Code to reproduce the rest of the experiments are comming soon.

Nearest Neighbors

Please follow this link for a list of nearest neighbors on ImageNet. Results are visualized from our ResNet50 feature, compared with baseline ResNet50 feature, raw image features and previous unsupervised features. First column is the query image, followed by 20 retrievals ranked by the similarity.

<img src="http://zhirongw.westus2.cloudapp.azure.com/figs/nn.png" width="800px"/>

Usage

Our code extends the pytorch implementation of imagenet classification in official pytorch release. Please refer to the official repo for details of data preparation and hardware configurations.

Citation

@inproceedings{wu2018improving,
  title={Improving Generalization via Scalable Neighborhood Component Analysis},
  author={Wu, Zhirong and Efros, Alexei A and Yu, Stella},
  booktitle={European Conference on Computer Vision (ECCV) 2018},
  year={2018}
}

Contact

For any questions, please feel free to reach

Zhirong Wu: xavibrowu@gmail.com

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.