tgisaturday / S3FD_ATSS_SAPD

Applying Adaptive Training Sample Selection and Soft Anchor Point Detection to S3FD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

S³FD_ATSS_SAPD: Single Shot Scale-invariant Face Detector

Applying Adaptive Training Sample Selection and Soft Anchor Point Detection to S3FD based on PyTorch Implementation of Single Shot Scale-invariant Face Detector

Description

To train hand and head dataset with S3FD, hand dataset is Egohands Dataset and head dataset is SCUT-HEAD

Requirement

  • pytorch 1.X.X
  • opencv
  • numpy
  • easydict
  • torchvision

Prepare data

  1. download WIDER face dataset,Egohands dataset and SCUT-HEAD
  2. modify data/config.py according to your home directory
  3. python prepare_wider_data.py
  4. python prepare_hand_dataset.py

Train

I selected face dataset for the training and evaluation of ATSS and SAPD applications.

python train.py --batch_size 4 --dataset face

Implementation Details

  1. 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.

  1. 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.

Evalution

I trained each model with WIDER face dataset for 100k iterations.

  1. Extract predictions on WIDER FACE
python wider_test.py
  1. 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/'.

Result

  1. 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

References

About

Applying Adaptive Training Sample Selection and Soft Anchor Point Detection to S3FD


Languages

Language:Python 92.1%Language:MATLAB 7.9%