PatchNet-FAS
A patch classifier for face anti-spoofing that recognizes the capture device and presenting material of a face patch.
Image classification · 79 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Image classification
- Parameters
- 11.2M
- Operations
- 79
- Framework
- PyTorch
- Recurrent
- No
- Published
- CVPR 2022
- Cited by
- 167 (as of 28 October 2026)
- Authors
- Chien-Yi Wang, Yu-Ding Lu, Shang-Ta Yang, Shang-Hong Lai
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m19276
- Graph hash
- 9713a5452aa055edebcd6daad1d403ba832a7e57406f96170648b3747c4bf165
- Skeleton hash
- c440f446eb09597a6bfcdd3d19169c8859603f029f1ffe979b64474ddf0bd872
- Architecture hash
- f9a9cdc606b54739c9d47d328116392bf5190eb0cb65d6c52082f2aed25fe3e3
- Diagram SHA-256
- 7930e84adceff98ff24a372dfdca9a3f42a04dbf3ead5298eb592ee45fc11343
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
PatchNet decides whether a face in front of a camera is live or a spoof by looking at small patches of the face image. It reformulates face anti-spoofing as a fine-grained patch-type recognition problem: the network recognizes the combination of capturing device and presenting material from patches cropped from non-distorted face images. The authors argue that this local information is needed to tell live from spoof images and that earlier work ignored it.
The paper uses ResNet18 as the patch feature encoder, with a fixed patch crop size of 160, and reports little performance difference with a larger encoder. Training uses the angular margin-based softmax loss common in face recognition and makes it asymmetric, with a larger angular margin on the live types so that live samples form a more compact cluster while spoof samples stay more dispersed. A self-supervised similarity loss applies the positive part of the contrastive loss to two transformed patch views from one face image, so that their features are similar.
At test time patches are cropped uniformly from the whole face image, and the live probability is the average over patches of the summed live class probabilities. The paper evaluates on intra-dataset, cross-dataset and domain generalization benchmarks, including OULU-NPU and SiW.
Key idea. PatchNet reformulates face anti-spoofing as fine-grained recognition of patch types, defined by capturing device and presenting material, trained with an asymmetric angular margin loss and a self-supervised similarity loss.
- patchnet
- patchnet-fas
- face anti-spoofing
- fas
- patch-type recognition
- presentation attack detection
- liveness detection
- asymmetric margin loss
- spoof detection
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{wang2022patchnetsimplefaceantispoofing,
title={PatchNet: A Simple Face Anti-Spoofing Framework via Fine-Grained Patch Recognition},
author={Chien-Yi Wang and Yu-Ding Lu and Shang-Ta Yang and Shang-Hong Lai},
year={2022},
eprint={2203.14325},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2203.14325},
}