Applying Adaptive Training Sample Selection and Soft Anchor Point Detection to S3FD based on PyTorch Implementation of Single Shot Scale-invariant Face Detector
To train hand and head dataset with S3FD, hand dataset is Egohands Dataset and head dataset is SCUT-HEAD
- pytorch 1.X.X
- opencv
- numpy
- easydict
- torchvision
- download WIDER face dataset,Egohands dataset and SCUT-HEAD
- modify data/config.py according to your home directory
python prepare_wider_data.py
python prepare_hand_dataset.py
I selected face dataset for the training and evaluation of ATSS and SAPD applications.
python train.py --batch_size 4 --dataset face
- Adaptive Training Sample Selection(ATSS)
-
I applied ATSS after the original sample selection part of S3FD in bbox_utils.py (line 193-223)
-
Unlike the original ATSS algorithm starting from empty candidate set, I used result positive set
from stage two of S3FD as starting candidate set. Other details follow the original ATSS algorithm.
- Soft Anchor Point Detection(SAPD)
-
I applied SAPD to the smoothed_L1_loss of S3FD in multibox_loss.py (line 109-107)
-
Anchor_weight calculation for generalized centerness function is done in bbox_utils.py (line 293)
-
I first multiply anchor_weight to the result of smoothed_L1_loss and devide the total sum of loss
with the sum of anchor_weight in multibox_loss.py (line 112-114) -
I tried to preserve the main concept of the original SAPD while modifying the generalized centerness
function to make it fit to the original regression loss of S3FD.
I trained each model with WIDER face dataset for 100k iterations.
- Extract predictions on WIDER FACE
python wider_test.py
- Evaluate predictions using WiderFace-Evaluation.
- Prediction results will be saved in 'eval_tools/s3fd_val'.
- Ground truth files are stored in 'eval_tools/wider_gt/'.
- Test on WIDER FACE
Easy AP Baseline = 0.946 ATSS_only = 0.944 SAPD_only = 0.943 ATSS_SAPD = 0.944
Medium AP Baseline = 0.932 ATSS_only = 0.931 SAPD_only = 0.930 ATSS_SAPD = 0.932
Hard AP Baseline = 0.849 ATSS_only = 0.846 SAPD_only = 0.847 ATSS_SAPD = 0.851