Skip to content

Code for our IJCNN'2020 paper, Neighborhood-Aware Attention Network for Semi-supervised Face Recognition (NAAN).

Notifications You must be signed in to change notification settings

labyrinth7x/NAAN

Repository files navigation

Neighborhood-Aware Attention Network for Semi-supervised Face Recognition

This repository is the official implementation of our IJCNN'20 paper Neighborhood-Aware Attention Network for Semi-supervised Face Recognition.

Requirements

  • Python >= 3.5
  • PyTorch >= 1.0.0
  • torchvision >= 0.2.1
  • numpy
  • tqdm

To install requirements:

pip install -r requirements.txt

Data Preparation

  • Download the full MS-Celeb-1M realeased by ArcFace from baidu or dropbox.
  • Download the splitted image list produced by learn-to-cluster from GoogleDrive or OneDrive.
  • Download the extracted features and precomputed knn for split0 (labeled) from GoogleDrive and move them to data/labeled.
  • Download the extracted features and precomputed knn for split1 (unlabeled) from GoogleDrive and move them to data/unlabeled. We also provide the pretrained face recognition model (ArcFace trained using only split0) from GoogleDrive. You can use it to extract/compute features and knn files for your own data and move them to data/unlabeled. The structure of data is the same as:
    data
     ├── labeled
        ├── split0_feats.npz
        ├── split0_knn.npy
     ├── unlabeled
        ├── split1_feats.npz
        ├── split1_knn.npy
        ├── split1_labels.txt
    

Training

sh train_gat.sh

Please note that:

  • We only use part0_train.list to train the GAT and classifier.
  • You can download the pre-trained model weights from GoogleDrive

Evaluation

  1. Generate pseudo labels for unlabeled data

    sh eval.sh
    

    Please note that:

    • You should change the param model_path with your own or use the default setting.
    • After preparing your own data, you can change the params knn_path and feat_path in eval_gat.py to generate pseudo labels.
  2. Evaluate with the true labels

    python statistics.py \
    pseudo_dir pseudl_data \
    split split1
    

    Please note that:

    • If your dirname of the generated pseudo label file is different, please replace pseudl_data with your own.
    • If your test set is not split1, please change split to your own data split.
    • It will output results, including BCubed Precision, BCubed Recall and BCubed F-measure.
    • The new pseudo_label_clean file will be saved into pseudo_dir by removing singleton clusters.

Joint Training Framework

You may refer to the following repository:
https://github.com/labyrinth7x/multi-task-face-recognition-framework

Results on split1_test

Method Precision Recall F-score
NAAN 97.0 86.8 91.6

After removing singleton clusters

Method Precision Recall F-score Discard ratio (%)
NAAN 96.9 93.6 95.2 4.2

Citation

Please cite our paper if it helps your research:

@inproceedings{DBLP:conf/ijcnn/ZhangLL19,
 author    = {Qi Zhang, Zhen Lei, Stan Z.Li},
 title     = {Neighborhood-Aware Attention Network for Semi-supervised Face Recognition},
 booktitle = {IJCNN},
 year      = {2020}

Ackownledgement

The codes for pseudo label propagation are from CDP. Thanks for their work.

About

Code for our IJCNN'2020 paper, Neighborhood-Aware Attention Network for Semi-supervised Face Recognition (NAAN).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published