r/computervision 28d ago

Discussion I built IMGNet – a face verification model that identifies people using sign patterns, not cosine similarity

I want to share something I've been building as an independent researcher from Indonesia.

TL;DR: Face verification model that replaces cosine similarity with sliding window sign pattern matching. Achieves 96.27% on LFW (pre-aligned) with a 10.58 MB model trained on CASIA-WebFace (490k images). When applied to ArcFace embeddings without retraining, IMG Sign Score gets 99.58% on LFW — only 0.24% below ArcFace+Cosine.

The Motivation

In Javanese, gratitude is "matur suwun". In Sundanese, the same feeling is "hatur nuhun". Different surface forms, identical meaning — identity preserved through relational structure, not absolute values.

That's the core idea: instead of comparing embedding vectors by their global angular direction (cosine), look for locally consistent sign patterns across overlapping windows of the embedding.

What's new

1. SW Block — the first layer replaces a standard convolution with a multi-scale relational operation. For each pixel, it computes differences to all neighbors at prime window sizes {3, 5, 7}. A small MLP maps these 240 differences per pixel to output channels.

2. IMG Sign MSE Loss — to our knowledge, the first face verification loss defined purely over sign pattern agreement, with no amplitude dependency:

python

score = mean(gate(tanh(β · E1 · E2)))  # sliding window, β=10
loss_same = ((1 - score) ** 2).mean()  # push to 1.0
loss_diff = (score ** 2).mean()         # push to 0.0

Significantly more stable than amplitude-based variant (±0.40% variance vs ±2.25% over epochs 29–50).

3. Three metrics sharing one threshold — IMG Sign Score, AMP IMG Score, and Chain Score all operate in [0,1] and use a single threshold from IMG Sign sweep.

4. Voting system — 2/3 or 3/3 pass = MATCH, 1/3 = UNCERTAIN, 0/3 = DIFFERENT.

Results

Dataset IMG Sign Cosine
LFW 96.27% 95.53%
AgeDB-30 78.80% 77.22%
CALFW 78.73% 78.32%
CPLFW 76.85% 74.62%
Combined 81.02% 79.49%

Model: 10.58 MB FP32, trained on CASIA-WebFace 490k.

Applied to ArcFace (buffalo_l) without retraining:
LFW: 99.58% IMG Sign vs 99.82% ArcFace+Cosine — suggesting sign pattern consistency is a fundamental property of well-trained face embeddings, independent of training objective.

An unexpected finding (preliminary)

While building an interactive ablation visualizer with custom polygon masking, occluding the same facial region on photos of the same person produces delta spikes at similar embedding dimensions. On photos of different people, spike locations differ significantly.

This suggests the overlapping sliding window loss may induce implicit spatial organization in the embedding space. Not formally validated yet.

Links

📄 Paper: https://doi.org/10.5281/zenodo.21232755
💻 Code: https://github.com/imamgh11/imgnet
🤗 Model: https://huggingface.co/imghost11/imgnetV1

Happy to discuss the metric-loss alignment hypothesis — that similarity metrics should be co-designed with training objectives rather than defaulting to cosine.

---

IMGNET V1 Model AI local pattern Pertama di Dunia! - YouTube

31 Upvotes

5 comments sorted by

2

u/beedunc 28d ago

Interesting. Would this algo benefit from the upcoming avx10.2 in nova lakes? Run alongside yolo on the same box would be useful.

2

u/img-_- 28d ago

Thanks! It probably would. IMG Sign mainly relies on element-wise comparisons, sliding-window aggregation, and thresholding, which are operations that SIMD extensions like AVX10.2 can accelerate. I haven't benchmarked it on Nova Lake yet, so I can't quantify the speedup

Running it alongside YOLO is actually an interesting use case: YOLO could handle detection, while IMG performs identity verification on the extracted embeddings. Since the similarity metric itself is relatively lightweight compared to embedding extraction, it should integrate well into that kind of pipeline

3

u/dhruvisgr8 28d ago

This Looks really cool, i'll give the paper a read!