Human Behavior Recognition Algorithm Based on HOG Feature and SVM Classifier
Human Behavior Recognition Algorithm Based on HOG Feature and SVM Classifier
978-1-7281-0945-9/19/$31.00©2019 IEEE
233
Authorized licensed use limited to: National University of Singapore. Downloaded on January 26,2025 at 07:53:15 UTC from IEEE Xplore. Restrictions apply.
Then, divide 360° of gradient direction into 9 direction blocks, The purpose of the SVM is to separate the boxes and circles,
as shown in Fig. 1. where the line is the result of the SVM classification [11-14].
yN e{ + 1, - 1 }
(4••
The linear discriminated function used for classification is
g (x •• •w• Tx + b (5 ˣ
wTxi + b > 0 , y. • •+ 1
III. Hu m a n b e h a v io r a n a l y s is b a s e d o n SVM
CLASSIFIER
A. Principle o f SVM algorithm The optimal solution of the classified hyperplane is generally
obtained by maximizing the classification interval. The sample
For a sample with two different data, as shown in Fig. 3,
points closest to the classified hyperplane are called support
the boxes and circles in the figure represent two different data.
vectors, and the support vectors determine the margin of the
234
Authorized licensed use limited to: National University of Singapore. Downloaded on January 26,2025 at 07:53:15 UTC from IEEE Xplore. Restrictions apply.
separated hyperplanes. The margin in Fig. 4 is the interval classification effect. Then, the objective function and
separating the hyperplanes. That is constraints in (9••become
2 . 1 2
margin • • - m in w +
w 2
(8 •• i• •1
0 ^ • ^•
N easier it is to accept noise. The value of margin can be made as
w a iy ix i = w a iy i x i large as possible by adjusting the value of C , and the number
of misclassified samples is as small as possible. The Lagrange
b,a••
• ,. • 0•
S L ( w , multiplier method of equation (16•• is used to obtain the
S b
:0 —• a,.y i• 1•
extreme value, and a new optimization problem can be
( 1 1 •• obtained as
N N N
max1••X1 XX
N ^ N
Q ( a ) = L ( w , b,a••• ^• a - - XX a i a j y iy j X j x j a 炻- - a 炻a j y , y J x T
i
i• 1• 2 i• 1• j• •1 a 2 i=1 j=1
( 1 2 ••
NS X
s t .
i• 1•
a > y> = 0
w = X ^^i x i
1,2,• ,•j
a i
i (13•• 0 ^ a —C , i =
* *T
(17••
b =y ,- w x炻
(14••
B . D e s ig n o f m u lti- c la s s ifie r
w*Tx + b * = 0
(15•• An SVM classifier can only perform two-class
classification, but human motion recognition is a multi-class
The linearly separable two-class case is ideal, but there is noise
problem, and only one SVM classifier cannot complete the
in the sample data that needs to be classified in the project,
classification. Multiple classification problems can be
which will lead to linear indivisibility, as shown in Fig. 5. A
converted to two- class problems. The following are two
slack variable • • can be introduced to classify linearly
specific solutions.
indivisible points.
The first method is to set one class as a positive sample,
and the other classes as negative samples, which can be
classified using a SVM classifier. Similarly, the remaining
classes can be classified in the same way. For a sample, each
SVM classifier makes a decision on whether it belongs to a
certain class or the rest of the class, and finally obtains the
recognition result. This method requires the same number of
SVM classifiers as the sample.
The second method is to convert the multi-class problem
into a single-to-single-class problem, and set up an SVM
classifier for each of the two classes. For n classes, n(n - 1 ) / 2
Fig. 5 Schematic diagram of linear inseparable problem
SVM classifiers are needed. When identifying one of the
Introducing the slack variable ^ in the constraint can allow samples, each SVM classifier votes, and the one with the
highest number of votes is the final recognition result.
the sample data on the wrong side to a certain extent, but ^
The categories of actions identified in this paper are
cannot be infinitely large, and increasing ^ will lead to an walking, waving, and backgrounds that do not contain the
increase in classification error. Therefore, it is necessary to human body. There are three categories. Therefore, it is
necessary to convert the multi-classification problem into a
control as small as possible while improving the two-category problem. In this paper, the first conversion
235
Authorized licensed use limited to: National University of Singapore. Downloaded on January 26,2025 at 07:53:15 UTC from IEEE Xplore. Restrictions apply.
method is employed. Two SVM classifiers are needed for the V. CONCLUSION
classification of walking and waving actions.
Human behavior analysis has a wide range of applications
in the field of computational vision. Non-rigidity of human
IV. EXPERIMENT behavior often leads to a low recognition rate. In order to
Experiments were conducted in the environment of VS2013 improve the recognition rate, a human behavior recognition
and OpenCV 2.4.9 using the UIUC Human Behavior Database. algorithm based on HOG feature and SVM classifier is
There are three types of categories to be classified in the proposed in this paper. The HOG feature of the image is first
training sample, including walking, waving, and the extracted and then the SVM multi-classifier is trained. The
background. Each category of samples includes 250 images experimental results show that in the UIUC human behavior
with a resolution of 64 • • 128 pixels, where the walking database, the method can effectively improve the recognition
samples and the wave samples are from the actions of four rate of walking and waving behavior.
people, and the background samples includes objects that are
not related to people, including a table, a wall and a house. Re f e r en ces
In the feature extraction process, the cell size is 8 ^ 8 pixels. [1] Chao S , Yufei C , Yao L , et al. Adaptive Human-Machine
Interactive Behavior Analysis With Wrist-Worn Devices for
Each block includes 4 cells. The bin number is 9, and the step Password Inference[J]. IEEE Transactions on Neural Networks and
size is 8x8 pixels. Therefore, the number of blocks is 7 x 15, Learning Systems, 2018:1-11.
and the dimension of the HOG descriptor is 7 x 15 x 4 x 9 • •
[2] Jaouedi N , Boujnah N , Bouhlel M S . Human Action
3780 dimensions. Recognition Using Wavelets of Derived Beta Distributions[C]//
International Conference on Parallel • • Distributed Computing.
In the classification process, the first classification method IEEE Computer Society, 2018.
is used to transform the three classification problem into a two
classification problem. The SVM classifier that recognizes the [3] Rautaray S S , Agrawal A . Vision based hand gesture recognition
for human computer interaction: a survey[J]. 2015.
walking action takes the walking sample as a positive sample,
the wave sample and the background sample as negative [4] Hongo H , Ohya M , Yasumoto M , et al. Face and hand gesture
recognition for human-computer interaction[C]// Pattern
samples. The SVM classifier that recognizes the wave action Recognition, 2000. Proceedings. 15th International Conference on.
takes the wave sample as a positive sample, the walk sample 2000.
and the background sample as negative samples. The H ˧G
[5] Johansson G . Visual perception of biological motion and a model
features of the samples are extracted and input into the SVM for its analysis[J]. Perception • •Psychophysics, 1973, 14.
classifier to train two classifiers. In the recognition process,
HOG feature of the target image is extracted, and the trained [6] J. Wang, H. Zha, R. Cipolla, “Coarse-to-Fine Vision-Based
Localization by Indexing Scale-Invariant Features”, IEEE Trans.
SVM classifier is used to perform the human behavior action on Systems, Man, and Cybernetics, 2006, 36(2••:413-422
classification.
[7] Yang Y, Chen S, Zhou Z, et al. An intelligent medical image
During the test process, 16 images were randomly understanding method using two-tier neural network ensembles[C]//
selected from each action for classification. Walk and wave International Conference on Innovations in Applied Artificial
Intelligence. 2005.
motions are marked with green and blue boxes, respectively.
The objective evaluation indicators of motion recognition are [8] Newell A J , Griffin L D . Multiscale histogram of oriented gradient
shown in Table 1. descriptors for robust character recognition[C]// International
Conference on Document Analysis • •Recognition. IEEE Computer
Society, 2011.
t a bl e I. Qualitative indexes of the Recognition results [9] Huang, Hsieh, Huang. Human Action Recognition Using Histogram
of Oriented Gradient of Motion History Image[C]// First
International Conference on Instrumentation. IEEE, 2012.
Q u a lita tiv e in d e x e s o f th e R e c o g n itio n resu lts
Sam [10] Xu G , Wu X , Liu L , et al. Real-time pedestrian detection based
p le on edge factor and Histogram of Oriented Gradient[C]// IEEE
cate W alkin g W avin g O th er W alk International Conference on Information • • Automation. IEEE,
T e st reco g n itio n reco g n itio n num be 2011.
gory in g A cc u
num be n u m b er n u m b er r erro r ra cy
r [11] Lei, Zhen. Histogram of oriented gradient detector with color-
ra te
invariant gradients in Gaussian color space[J]. Optical Engineering,
Wal 87.5 2010, 49(10••:109701.
16 14 2 0 0
king • •
Wav 87.5 [12] Schuldt C , Laptev I , Caputo B . Recognizing human actions: a
16 1 15 0 6.3• •
ing • • local SVM approach[C]// Proceedings of the 17th International
Othe 93.5 Conference on Pattern Recognition, 2004. ICPR 2004. IEEE, 2004.
16 0 1 15 6.3• •
rs • • [13] Hsieh C J , Chang K W , Lin C J , et al. A dual coordinate descent
In Table 1, the recognition rate of the proposed algorithm method for large-scale linear SVM[C]// Proc International
for the wave and walk is 87.5• •and 93.5• •, respectively. The Conference on Machine Learning. ACM, 2008.
average accuracy is as high as 90.5• .• [14] Chauhan V K , Dahiya K , Sharma A . Problem formulations and
solvers in linear SVM: a review[J]. Artificial Intelligence Review,
2018.
236
Authorized licensed use limited to: National University of Singapore. Downloaded on January 26,2025 at 07:53:15 UTC from IEEE Xplore. Restrictions apply.