This repository is the official implementation of our IJCNN'20 paper Neighborhood-Aware Attention Network for
Semi-supervised Face Recognition.
- Python >= 3.5
- PyTorch >= 1.0.0
- torchvision >= 0.2.1
- numpy
- tqdm
To install requirements:
pip install -r requirements.txt
- 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 todata/unlabeled
. The structure ofdata
is the same as:data ├── labeled ├── split0_feats.npz ├── split0_knn.npy ├── unlabeled ├── split1_feats.npz ├── split1_knn.npy ├── split1_labels.txt
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.
-
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
andfeat_path
ineval_gat.py
to generate pseudo labels.
- You should change the param
-
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 changesplit
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.
- If your dirname of the generated pseudo label file is different, please replace
You may refer to the following repository:
https://github.com/labyrinth7x/multi-task-face-recognition-framework
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 |
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}
The codes for pseudo label propagation are from CDP. Thanks for their work.