https://github.com/ternaus/datasouls_antispoof
Code and pre-trained models for detecting spoofing attacks from images.
https://github.com/ternaus/datasouls_antispoof
antispoofing computer-vision deep-learning image-classification liveness-detection neural-network
Last synced: 9 months ago
JSON representation
Code and pre-trained models for detecting spoofing attacks from images.
- Host: GitHub
- URL: https://github.com/ternaus/datasouls_antispoof
- Owner: ternaus
- License: apache-2.0
- Created: 2020-11-30T20:34:16.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-02T21:08:03.000Z (over 5 years ago)
- Last Synced: 2025-09-27T15:30:57.185Z (9 months ago)
- Topics: antispoofing, computer-vision, deep-learning, image-classification, liveness-detection, neural-network
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 39
- Watchers: 3
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Anti spoofing with the Datasouls dataset

## Installation
`pip install -U datasouls_antispoof`
### Example inference
Colab notebook with the example: [](https://colab.research.google.com/drive/1HN0xmAUjfgVLccCV_QQ2Zg98WD9BZeNW?usp=sharing)
## Dataset
[ID & RD anti spoofing challenge](https://ods.ai/competitions/idrnd-facial-antispoofing)
Four types of images:
* real
* replay
* printed
* mask2d
## Training
### Define the config.
Example at [datasoluls_antispoof/configs](datasouls_antispoof/configs)
### Define the environmental variable `IMAGE_PATH` that points to the folder with the dataset.
Example:
```bash
export IMAGE_PATH=
```
## Inference
```bash
python -m torch.distributed.launch --nproc_per_node= datasouls_antispoof/inference.py \
-i \
-c \
-w \
-o \
--fp16
```
## Pre-trained models
| Models | Validation accuracy | Config file | Weights |
| ------------- |:--------------------:| :------------:| :------: |
| swsl_resnext50_32x4d | 0.9673 | [Link](datasouls_antispoof/configs/2020-11-30b.yaml) | [Link](https://github.com/ternaus/datasouls_antispoof/releases/download/0.0.1/2020-11-30b_resnext50_32x4d.zip) |
| tf_efficientnet_b3_ns | 0.9927 |[Link](datasoluls_antispoof/configs/2020-12-02.yaml)| [Link](https://github.com/ternaus/datasouls_antispoof/releases/download/0.0.2/2020-12-02_efficientnet_b3.zip)|