An Optimization Method for Personnel Statistics Based on YOLOv4 + DPAC
Abstract
:1. Introduction
2. Methodology
2.1. Experimental Environment
2.2. Dataset
2.3. Detection Network
2.4. Distribution Probability Adjustment Confidence
2.4.1. DPAC Function
2.4.2. Obtain Distribution by Unsupervised Learning
3. Experiment
3.1. Preliminary Experiment
3.1.1. Obtain Target Distribution
3.1.2. Unsupervised Learning Computing Distribution Experiment
- (a)
- When using unsupervised learning to compute the distribution, DPAC was not added in the early stage. After running for a period of time determined according to the distribution obtained by unsupervised learning, add DPAC into the network. In this way, the normal target recognition will not be affected and interrupted when calculating the video distribution.
- (b)
- In order to eliminate and reduce the effects of FP on the distribution, we can use a target with a large confidence threshold that can be adopted as the distribution data.
- (c)
- Distribution statistics can be performed at any time to update existing DPAC parameters as needed due to changes in the angle, environment, or location.
3.1.3. Obtain the Adjustment Matrix
3.1.4. Confidence Adjustment
- (a)
- The format of the i-th target output detected after the image passes through the YOLO detection network is category, confidence C, and location coordinates (left, top, right, and bottom).
- (b)
- Obtain the coordinates of the target center point according to Formulas (3) and (4): .
- (c)
- The value in the distribution matrix of Figure 3 corresponds to the target center point: .
- (d)
- The value in the adjustment matrix of Figure 6 corresponds to the target center point: .
- (e)
- According to Formula (2), if > ri−1 and < ri, then = ai.
- (d)
- The new confidence value is Cnew = C × ai.
3.2. YOLOv4 Network Training
- (a)
- Before YOLOv4 network training, configure the training data label set, data image set, weight, and other files. The label file contains the location of the training set image and the target distribution in the image. The class file contains training target categories, and only one category for head recognition was used in this experiment. The weight file adopts “yolo4_weight.h5”, and the weight of the original model can also be considered as a kind of transfer learning.
- (b)
- Start training and obtain the model parameters:
- Total params: 64,003,990;
- Trainable params: 63,937,686;
- Non-trainable params: 66,304.
- (c)
- Obtain the training results.
3.3. DPAC Experimental Design
Model | DPAC |
---|---|
YOLOv4 | None |
DPAC (a) | |
DPAC (b) | |
DPAC (c) |
4. Results
4.1. YOLOv4 + DPAC Test Results
4.2. Analysis of Experimental Examples
5. Discussion
- (a)
- DPAC can describe the distribution as being very low, low, high, and very high.
- (b)
- When the distribution is very low, multiply it by a factor less than one.
- (c)
- When the probability distribution is low, it indicates that the density in this area is low, that the target overlaps, and that the possibility of occlusion is small, so multiply it by a factor greater than one.
- (d)
- When the distribution probability is high, it indicates that the target in this area is highly likely to appear, so multiply it by a coefficient greater than 1.
- (e)
- When the distribution probability is very high, it is easier for high-density target groups to appear in this area. When the high-density target groups overlap, the possibility of occlusion is large, and there are more interference factors. Therefore, multiplying by a coefficient less than 1 is helpful to reduce FP. However, when the number of predictions obtained on the detected image is relatively small, it can be considered that there is no high-density target area on the image. These regions are similar to regions with a high probability distribution, meaning that they can be multiplied by a coefficient greater than one.
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Zhong, K. Research on Students’ Interest in Classroom Based on Video. Master’ Thesis, Hainan Normal University, Haikou, China, 2021. [Google Scholar]
- Mumbai Stampede. Available online: https://news.cgtn.com/news/7a59444e78597a6333566d54/index.html (accessed on 29 September 2017).
- Israeli Stampede. Available online: https://newsus.cgtn.com/news/2021-05-01/Investigation-underway-into-causes-of-Israeli-stampede-that-killed-45-ZTsVGgwDuw/index.html (accessed on 1 May 2021).
- Lienhart, R.; Maydt, J. An extended set of haar-like features for rapid object detection. In Proceedings of the International Conference on Image Processing, Rochester, NY, USA, 22–25 September 2002; pp. 1–4. [Google Scholar]
- Cao, Y.; Miao, Q.; Liu, J.; Gao, L. Research progress and prospect of Adaboost algorithm. J. Autom 2013, 17, 342–351. [Google Scholar]
- He, K.; Sun, J.; Tang, X. Single image haze removal using dark channel prior. IEEE Trans. Pattern Anal. Mach. Intell. 2010, 33, 2341–2353. [Google Scholar] [PubMed]
- Ahmad, A.S.; Hassan, M.Y.; Abdullah, M.P.; Rahman, H.A.; Hussin, F.; Abdullah, H.; Saidur, R. A review on applications of ANN and SVM for building electrical energy consumption forecasting. Renew. Sustain. Energy Rev. 2014, 33, 102–109. [Google Scholar] [CrossRef]
- Felzenszwalb, P.F.; Girshick, R.B.; McAllester, D.; Ramanan, D. Object detection with discriminatively trained part-based models. IEEE Trans. Pattern Anal. Mach. Intell. 2010, 32, 1627–1645. [Google Scholar] [CrossRef] [PubMed]
- Hinton, G.E.; Osindero, S.; Teh, Y.-W. A fast learning algorithm for deep belief nets. Neural Comput. 2006, 18, 1527–1554. [Google Scholar] [CrossRef] [PubMed]
- LeCun, Y.; Bottou, L.; Bengio, Y.; Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 1998, 86, 2278–2324. [Google Scholar] [CrossRef]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. Imagenet classification with deep convolutional neural networks. Adv. Neural Inf. Processing Syst. 2012, 1, 1097–1105. [Google Scholar] [CrossRef]
- Szegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.; Anguelov, D.; Erhan, D.; Vanhoucke, V.; Rabinovich, A. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 1–9. [Google Scholar]
- Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv 2015, arXiv:1409.1556. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.-Y.; Berg, A.C. Ssd: Single shot multibox detector. In Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 8–16 October 2016; pp. 21–37. [Google Scholar]
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Columbus, OH, USA, 23–28 June 2014; pp. 580–587. [Google Scholar]
- Girshick, R. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. Adv. Neural Inf. Processing Syst. 2015, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Lu, L.; Hu, C.; Hongtai, Z.; Nianshu, D. Progress of Research and Application of Object Detection Based on Deep Learning. Electron. Packag. 2022, 22, 1–9. [Google Scholar]
- Bochkovskiy, A.; Wang, C.; Liao, H.M. YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- YOLOv5 Object Detection Architecture and Model. Available online: https://github.com/ultralytics/yolov5 (accessed on 13 December 2020).
- Zhang, K.; Xie, D. Research on Detection and Statistical System of Number of People in Classroom based on Linux and OpenCV. Comput. Knowl. Technol. 2016, 12, 187–191. [Google Scholar]
- Zhou, Z.; Tian, X.; Lingling, H.E.; Ren, J. Research on People Counting Recognition Algorithms Based on Bayesian Classi-fication. J. Beijing Inst. Petrochem. Technol. 2019, 27, 47–53. [Google Scholar]
- Xu, Y.; Zhang, J.; Wang, R.; Guan, J.; Xu, C. Statistical Method of Number in Construction Elevator Based on Convolution Neural Network. Mod. Manuf. Technol. Equip. 2021, 57, 9–12. [Google Scholar]
- Wang, Y. The Research and Implementation of Head Detection in Complex Scenes Based on Deep Learning. Master’s Thesis, Huazhong University of Science & Technology, Wuhan, China, 2019. [Google Scholar]
- Yi, D. Research on Target Detection Optimization Algorithm Based on YOLO. Master’s Thesis, Nanjing University of Posts and Telecommunications, Nanjing, China, 2021. [Google Scholar]
- Chen, Y.; Jiao, L.; Cao, X. Video Stream Target Detection Algorithm Based on Time-correlation Correction of Confidence. Mod. Comput. 2021, 27, 21–26. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLOv3: An Incremental Improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
- Vora, A.; Chilaka, V. FCHD: Fast and accurate head detection in crowded scenes. arXiv 2019, arXiv:1809.08766v3. [Google Scholar]
- Zhong, Y.; Wang, J.; Peng, J.; Zhang, L. Anchor box optimization for object detection. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Snowmass Village, CO, USA, 1–5 March 2020; pp. 1286–1294. [Google Scholar]
Category | Name | Configure |
---|---|---|
Hardware | CPU | intel(R)Xeon(R) Gold 6238R CPU 2.20 GHz (2 processors) |
GPU | Tesla T4 16 GB | |
Memory | (RAM) 512 GB | |
Hard disk | SAS | |
Software | Operating system | Windows server 2016 Standard 64-bit |
Programming language | Python 3.8.6 | |
Programming platform | VCode 1.62.3 | |
GPU driver | NVIDIA CUDA 11.4.94 driver |
Picture Category | Training Images | Validation Images | Test Images |
---|---|---|---|
Number | 6251 | 695 | 482 |
Network | ReInspect | Opt (k-means) | YOLO-OFLSTM | Ours |
AP | 78% | 80.18% | 87.1% | 89.45% |
DPAC | Errors Number | Correct Number | Detection Number | GT Number | AP Confidence 0.5 | Recall | Precision |
---|---|---|---|---|---|---|---|
None | 241 | 4265 | 4506 | 4989 | 84.44% | 85.49% | 94.65% |
ƒ1(x) | 255 | 4284 | 4539 | 4989 | 84.80% | 85.87% | 94.38% |
ƒ2(x) | 239 | 4266 | 4505 | 4989 | 84.46% | 85.51% | 94.69% |
ƒ3(x) | 239 | 4271 | 4510 | 4989 | 84.56% | 85.61% | 94.70% |
DPAC | Speed of First Test | Speed of Second Test | Speed of Third Test | Average Speed |
---|---|---|---|---|
Disable | 4.31 | 4.35 | 4.23 | 4.30 |
Enable | 4.24 | 4.26 | 4.33 | 4.28 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Chen, W.; Wu, G.; Jung, H. An Optimization Method for Personnel Statistics Based on YOLOv4 + DPAC. Appl. Sci. 2022, 12, 8627. https://doi.org/10.3390/app12178627
Chen W, Wu G, Jung H. An Optimization Method for Personnel Statistics Based on YOLOv4 + DPAC. Applied Sciences. 2022; 12(17):8627. https://doi.org/10.3390/app12178627
Chicago/Turabian StyleChen, Wenhui, Guanchen Wu, and Hoekyung Jung. 2022. "An Optimization Method for Personnel Statistics Based on YOLOv4 + DPAC" Applied Sciences 12, no. 17: 8627. https://doi.org/10.3390/app12178627
APA StyleChen, W., Wu, G., & Jung, H. (2022). An Optimization Method for Personnel Statistics Based on YOLOv4 + DPAC. Applied Sciences, 12(17), 8627. https://doi.org/10.3390/app12178627