wujixiu / helmet-detection

Helmet Detection on Construction Sites
Apache License 2.0
351 stars 117 forks source link
deep-learning helmet-detection ssd-pelee

Automatic Hardhat Wearing Detection

Detecting hardhat-use and identifying the corresponding colors of a hardhat on construction sites based on SSD framework.

Introduction

This work tries to automate the monitoring of whether people are wearing hardhat on the construction sites and identify the corresponding colors. Currently, on the proposed dataset of GDUT-Hardhat Wearing Detection (GDUT-HWD), the SSD model combined with our reverse progressive attention (SSD-RPA) achieves 83.89% mAP with the input size 512×512. In addition, we have released models that are suitable for mobile devices.

Preparation

  1. Install dependencies the Caffe framework needs. You can visit the caffe official website and follow the instructions there to install the dependent libraries and drivers correctly.

  2. Clone the SSD-RPA repository and compile the code.

    git clone https://github.com/wujixiu/helmet-detection.git
    
    cd helmet-detection/hardhat-wearing-detection/SSD-RPA/
    
    make all -j8
  3. following the instructions in SSD (https://github.com/weiliu89/caffe/tree/ssd) to prepare data.

Train a model (on Linux)

Suppose the code is running under the SSD-RPA directory and data is prepared.

  1. Download VGG_ILSVRC_16_layers_fc_reduced or peleenet and put them in models directory.
  2. Run the training scripts.
sh examples/Hardhat/SSD300/train_SSD300.sh

Deploy a pre-trained model

All models are based on Caffe.

Notable that different models have different input size and different input scale. Details are shown below.

Models Input size mean input scale
SqueezeNet-SSD 300×300 (104,117,123) 0.017
MobileNet-SSD 300×300 (127.5,127.5,127.5) 0.007843
Pelee 304×304 (103.94,116.78,123.68) 0.017
Pelee-RPA 304×304 (103.94,116.78,123.68) 0.017
SSD-RPA300 300×300 (104,117,123) 1
SSD-RPA512 512×512 (104,117,123) 1

Released data and models

Label trainval test total
blue 1251 1361 2612
white 1813 1968 3781
yellow 1936 1962 3898
red 2148 2083 4231
none 2171 2200 4371
small (area ≤ 32×32) 4237 4713 8950
medium (32×32<area ≤ 96×96) 4098 3826 7924
large (area > 96×96) 984 1035 2019

Data and weights are available in Google Drive

Examples

Citation

Please cite the paper in your publications if it helps your research.

Jixiu Wu, Nian Cai, Wenjie Chen, Huiheng Wang, Guotian Wang , Automatic detection of hardhats worn by construction personnel: A deep learning approach and benchmark dataset, Automation in Construction, 106(2019), 10.1016/j.autcon.2019.102894.

Link to the paper.