RipPLE: Concentric Hypersphere Embedding for Pairwise Similarity Learning

RipPLE is a pairwise metric learning method for face recognition that keeps embeddings off the unit hypersphere. The direction of an embedding encodes identity and its norm encodes how much evidence the input provides, learned end-to-end by the pairwise loss and used at scoring time. Under occlusion, extreme pose or blur, both genuine and impostor scores converge toward zero instead of overlapping, so a small absolute score marks a pair as hard to decide rather than wrongly decided.

The norm also acts as the temperature of the loss, so an unconstrained norm hampers convergence while fixing every norm removes the evidence. RipPLE therefore introduces the expected norm constraint (ENC): only the mean norm over a training batch is anchored, and every individual norm stays free.

Model Details

Model Description

  • Developed by: Zhe Xu, Yandong Wen
  • Model type: proxy-free pairwise metric learning; 512-d embedding, input 112x112 RGB
  • Backbones: IResNet-100, SFNet-64
  • Training data: MS1MV2
  • License: MIT for code and weights; released for research use only
  • Repository: https://github.com/bili186/Ripple
  • Paper: Concentric Hypersphere Embedding for Pairwise Similarity Learning (under review, arXiv link to be added)

Each checkpoint is a plain dict with two state dicts, backbone and head; optimizer state is not included.

Released checkpoints

File Backbone Head / anchor Key hyperparameters
iresnet100-ms1m-ripple.pth IResNet-100 RipPLE (arithmetic mean ENC) L=10, lambda_=1, m=10, alpha=1e-4
sfnet64-ms1m-ripple.pth SFNet-64 RipPLE (arithmetic mean ENC) L=10, lambda_=1, m=10, alpha=1e-4
iresnet100-ms1m-simple_ENC.pth IResNet-100 SimPLE(enc=True) (ENC on SimPLE) L=6, lambda_=1, r=3, m=3.6, alpha=5e-4
sfnet64-ms1m-simple_ENC.pth SFNet-64 SimPLE(enc=True) (ENC on SimPLE) L=6, lambda_=1, r=3, m=3.6, alpha=5e-4
iresnet100-ms1m-ripple-gm-exp.pth IResNet-100 RipPLE_GM (geometric-mean ENC, exponential norm map) L=9, lambda_=0.1, m=6, alpha=1e-4
iresnet100-ms1m-ripple-gm-polar.pth IResNet-100 RipPLE_GM (geometric-mean ENC, polar norm map) L=9, lambda_=1, m=8.1, alpha=2e-4
iresnet100-ms1m-ripple-p.pth IResNet-100 RipPLE_P (per-pair ENC) L=10, lambda_=1, m=10, alpha=1e-4

All heads use wrap_mode: polarlike except -gm-exp, which uses explike, and b_theta=0.3. The matching training config of every run is in configs/.

Scoring

Similarity is the generalized inner product

S(x1, x2) = ||x1|| * ||x2|| * (cos(x1, x2) - b_theta),   b_theta = 0.3

Template features are fused from the original and flipped image with equal 0.5/0.5 weights; multi-image templates use media-deduplicated weights. A pair with a small absolute score is ambiguous.

Uses

Direct Use

  • 1:1 face verification (TAR at low FAR)
  • 1:N identification (TPIR@FPIR, rank-1)
  • Embedding extraction for arbitrary aligned face image folders
  • Image-level quality ranking inside a template: the norm is monotonically related to input evidence

Downstream Use

The embeddings can serve as features for clustering, deduplication, template aggregation or quality-aware retrieval pipelines.

Out-of-Scope Use

  • Surveillance, identity tracking or any use without informed consent of the subjects
  • Law enforcement, border control, hiring, housing, insurance or other high-stakes decisions about individuals
  • Any application where a false match can cause harm without human review
  • Demographic-fairness-critical deployments: no fairness guarantee is claimed for any subgroup

Bias, Risks, and Limitations

  • MS1MV2 is a large web-collected dataset whose demographic composition is not documented in detail; accuracy may differ across age, gender, ethnicity, pose and image quality
  • Low-resolution, heavily occluded or compressed images have small embedding norms; the resulting scores shrink toward zero, which reflects uncertainty but also means thresholds calibrated on clean data can behave differently on degraded data
  • The norm is a learned scalar, not a calibrated probability, and it should not be used to delete images in production without an audit
  • Reported numbers follow the IJB-B/IJB-C protocols and are not a guarantee of field performance

Recommendations

Treat outputs as similarity evidence, not as identity verification, in any consequential setting. Calibrate the threshold on target-domain data, keep a human in the loop for reject decisions, and comply with local biometric data regulations.

How to Get Started

git clone https://github.com/bili186/Ripple.git
cd Ripple
conda env create -f environment.yml
conda activate ripple

Download a checkpoint and its config, then run evaluation:

mkdir -p project/ripple_pretrained/checkpoint
cp configs/iresnet100-ms1m-ripple.yml project/ripple_pretrained/config.yml
cp checkpoints/iresnet100-ms1m-ripple.pth \
   project/ripple_pretrained/checkpoint/best_model_CB_ACC.pth

CUDA_VISIBLE_DEVICES=0 python main_test.py \
    --cfg_path config/test/ijbc.yml \
    --proj_dir project/ripple_pretrained \
    --model_path project/ripple_pretrained/checkpoint/best_model_CB_ACC.pth

For feature extraction on a folder of images:

python main_inference.py --image_dir <your_images> \
    --proj_dir project/ripple_pretrained

Loading the weights directly:

import yaml
import torch
from opensphere.utils.build_helper import build_from_args

cfg = yaml.safe_load(open('configs/iresnet100-ms1m-ripple.yml'))
state = torch.load('checkpoints/iresnet100-ms1m-ripple.pth', map_location='cpu')
backbone = build_from_args(dict(cfg['model']['backbone']), 'opensphere.module.backbone')
head = build_from_args(dict(cfg['model']['head']), 'opensphere.module.head')
backbone.load_state_dict(state['backbone'])
head.load_state_dict(state['head'])
backbone.eval()
head.eval()

Training Details

Training Data

MS1MV2 (InsightFace-style aligned 112x112 crops).

Training Procedure

  • Optimizer: SGD, lr 0.1 (head lr 0.01), momentum 0.9, weight decay 5e-4, MultiStepLR with milestones at 80k/140k/200k/240k steps, gamma 0.1
  • Schedule: 240k iterations, batch size 128 per GPU
  • Precision: automatic mixed precision (fp16)
  • Pair sampling: proxy-free pairwise batches, MoCo-style EMA feature bank of 524,288 entries with momentum 0.999
  • Augmentation: horizontal flip; low-resolution, crop and photo degradation with probability 0.2 each
  • Loss: asymmetric BCE on pairwise logits (positive weight alpha) plus the anchoring term of the chosen head

Evaluation

Testing Data, Factors & Metrics

  • Data: IJB-B and IJB-C
  • Protocols: 1:1 verification (TAR@FAR=1e-6/1e-5/1e-4) and 1:N identification (rank-1, TPIR@FPIR=1e-2)
  • Template aggregation: media-deduplicated weighting, original + flipped image fusion

Results

IResNet-100, trained on MS1MV2 for 240k steps. Numbers of compared methods are quoted from their papers.

Method IJB-B 1e-6 IJB-B 1e-5 IJB-B 1e-4 IJB-C 1e-6 IJB-C 1e-5 IJB-C 1e-4 1:N top1 (B/C) 1:N TPIR@1e-2 (B/C)
SimPLE 49.87 91.13 94.78 90.30 94.34 96.27 95.54 / 96.81 85.92 / 92.88
SimPLE+ENC 51.89 91.88 95.35 90.55 94.61 96.66 95.42 / 96.78 84.34 / 93.01
RipPLE 44.72 92.57 95.50 92.13 95.09 96.82 95.41 / 96.75 87.21 / 93.89
RipPLE-P 44.63 92.19 95.37 90.19 94.93 96.67 95.05 / 96.34 85.29 / 93.29
RipPLE-GM 38.76 92.01 95.20 90.75 94.78 96.58 95.27 / 96.58 87.32 / 93.30

Quality filtering with the RipPLE-P norm, discarding the lowest-norm fraction of template frames, moves TAR@FAR=1e-4 from 94.71 to 98.37 on IJB-B and from 96.60 to 99.47 on IJB-C.

Environmental Impact

Compute hours and carbon emissions were not tracked for these runs. Training used 2 GPUs with mixed precision.

Citation

@inproceedings{wen2023simple,
  title     = {Pairwise Similarity Learning is SimPLE},
  author    = {Wen, Yandong and Liu, Weiyang and Feng, Yao and Raj, Bhiksha and Singh, Rita and Weller, Adrian and Black, Michael J. and Sch{\"o}lkopf, Bernhard},
  booktitle = {ICCV},
  year      = {2023}
}

@article{liu2022spherefacer,
  title     = {SphereFace Revived: Unifying Hyperspherical Face Recognition},
  author    = {Liu, Weiyang and Wen, Yandong and Raj, Bhiksha and Singh, Rita and Weller, Adrian},
  journal   = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year      = {2022}
}

The RipPLE paper is under review; its BibTeX entry will be added upon release.

Model Card Contact

Zhe Xu, Yandong Wen. Please open an issue at https://github.com/bili186/Ripple.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support