Skip to content
프로젝트

zhirongw/lemniscate.pytorch

GitHub에서 보기

소개

비모수 인스턴스 판별을 통한 비지도 특징 학습

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
0

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Unsupervised Feature Learning via Non-parameteric Instance Discrimination

This repo constains the pytorch implementation for the CVPR2018 unsupervised learning paper (arxiv).

Updated Pretrained Model

An updated instance discrimination model with memory bank implementation and with nce-k=65536 negatives is provided. The updated model is trained with Softmax-CE loss as in CPC/MoCo instead of the original NCE loss.

Oldies: original releases of ResNet18 and ResNet50 trained with 4096 negatives and the NCE loss. Each tar ball contains the feature representation of all ImageNet training images (600 mb) and model weights (100-200mb). You can also get these representations by forwarding the network for the entire ImageNet images.

  • ResNet 18 (top 1 nearest neighbor accuracy 41.0%)
  • ResNet 50 (top 1 nearest neighbor accuracy 46.8%)

Highlight

  • We formulate unsupervised learning from a completely different non-parametric perspective.
  • Feature encodings can be as compact as 128 dimension for each image.
  • Enjoys the benefit of advanced architectures and techniques from supervised learning.
  • Runs seamlessly with nearest neighbor classifiers.

Nearest Neighbor

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

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.

  • supports python27 and pytorch=0.4

  • if you are looking for pytorch 0.3, please switch to tag v0.3

  • clone this repo: git clone https://github.com/zhirongw/lemniscate.pytorch

  • Training on ImageNet:

    python main.py DATAPATH --arch resnet18 -j 32 --nce-k 4096 --nce-t 0.07 --lr 0.03 --nce-m 0.5 --low-dim 128 -b 256

    • parameter nce-k controls the number of negative samples. If nce-k sets to 0, the code also supports full softmax learning.
    • nce-t controls temperature of the distribution. 0.07-0.1 works well in practice.
    • nce-m stabilizes the learning process. A value of 0.5 works well in practice.
    • learning rate is initialized to 0.03, a bit smaller than standard supervised learning.
    • the embedding size is controlled by the parameter low-dim.
  • During training, we monitor the supervised validation accuracy by K nearest neighbor with K=1, as it's faster, and gives a good estimation of the feature quality.

  • Testing on ImageNet:

    python main.py DATAPATH --arch resnet18 --resume input_model.pth.tar -e runs testing with default K=200 neighbors.

  • Training on CIFAR10:

    python cifar.py --nce-k 0 --nce-t 0.1 --lr 0.03

Citation

@inproceedings{wu2018unsupervised,
  title={Unsupervised Feature Learning via Non-Parametric Instance Discrimination},
  author={Wu, Zhirong and Xiong, Yuanjun and Stella, X Yu and Lin, Dahua},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  year={2018}
}

Contact

For any questions, please feel free to reach

Zhirong Wu: [email protected]

관련 프로젝트 살펴보기

불러오는 중…