0% found this document useful (0 votes)
30 views4 pages

Human Behavior Recognition Algorithm Based on HOG Feature and SVM Classifier

This document presents a human behavior recognition algorithm that utilizes Histogram of Oriented Gradients (HOG) features and a Support Vector Machine (SVM) classifier to improve recognition accuracy in computer vision applications. The method involves extracting HOG features from images, transforming multi-class problems into dual-class problems, and training multiple SVM classifiers to recognize walking and waving behaviors. Experimental results indicate that the proposed approach achieves a recognition rate of 87.5% on the UIUC database, demonstrating its effectiveness in human behavior analysis.

Uploaded by

samson020202
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views4 pages

Human Behavior Recognition Algorithm Based on HOG Feature and SVM Classifier

This document presents a human behavior recognition algorithm that utilizes Histogram of Oriented Gradients (HOG) features and a Support Vector Machine (SVM) classifier to improve recognition accuracy in computer vision applications. The method involves extracting HOG features from images, transforming multi-class problems into dual-class problems, and training multiple SVM classifiers to recognize walking and waving behaviors. Experimental results indicate that the proposed approach achieves a recognition rate of 87.5% on the UIUC database, demonstrating its effectiveness in human behavior analysis.

Uploaded by

samson020202
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Human Behavior Recognition Algorithm Based on

HOG Feature and SVM Classifier


Qing Cai
Jiangsu Automation Research Institute, Lianyungang, Jiangsu Province, China, 222061
[email protected]

Abstract~Human behavior analysis is a hot research in the field


of computer vision. It has broad application prospects in the II. Fe a t u r e e x t r a c t io n o f HOG
fields of intelligent monitoring, human-computer interaction, HOG is a feature descriptor that can be obtained by
motion analysis and virtual reality. In order to improve the calculating and counting the gradient direction histogram o f the
accuracy of human behavior recognition, a human behavior
local region of the image [8-10]. The process of HOG feature
recognition method based on HOG feature and SVM classifier is
extraction is actually the extraction process o f the partial image
proposed. First, the HOG features of the training set and the test
set are extracted. Then, the multi-class problem is transformed
edge gradient, including six steps.
into multiple dual-class problems, and multiple SVM classifiers
are trained by using the HOG features. Finally, the trained A. Convert to grayscale
classifiers are employed to recognize the human walking and HOG features are not affected by image color changes.
waving behavior. Experimental results show that the recognition Therefore, the color image can be grayed out, simplifying the
rate of walking and waving is 87.5% for the UIUC database. The calculation process.
human behavior recognition method proposed in this paper can
effectively improve the recognition rate.
B. Standardization using Gamma correction
Keywords- human behavior analysis; support vector machine; Gamma correction normalizes the image to reduce the
histogram o f oriented gradient interference from light and shadow. The Gamma compression
formula is
I. In t r o d u c t io n
• • • • • • •• • y ••r (1••
Human behavior analysis is a hot research direction in the
field of computer vision. This technology uses cameras and where y is an empirical value, such as /• •0 .5 .
computers to capture human movements and process them to
analyze human behaviors. This technology has broad
application prospects in the fields of intelligent monitoring, C. Calculate the image gradient
human-computer interaction, motion analysis and virtual The derivation operation can obtain texture information
reality [1-3]. such as contours and figures in the image, and further reduce
the interference o f illumination. The gradient expression in the
The research on human behavior analysis technology in
horizontal and vertical directions of the pixel (x, y •• in the
foreign countries began in 1970s. The human motion
perception experiment designed by Johansson is the earliest image is obtained as
research on human behavior analysis [4].. The Peking
University Audio-Visual Information Processing Laboratory, \ Gx(x, y••• •I ( x + 1, y ••- 1 (x -1 , y••
the Institute of Automation of the Chinese Academy of <[Gy(x, y • • •I•(x, y + 1••- 1 (x, y -1 •• (2.'
Sciences and the Institute o f Computing Technology o f the
Chinese Academy o f Sciences have all achieved certain where G (x, y•• and Gy (x, y •• represent the gradient in the
research results in this field [5-6]. In addition, Wuhan
University and Nanjing University have achieved good results horizontal and vertical direction, respectively. The gradient
in the research o f locating and tracking the three-dimensional magnitude and direction o f the pixel can be obtained as
behavior of targets [7].
G( x, y••• •^G x(x,y••2 +G y(x,y ) 2
In this paper, a human behavior classification method based
on HOG features and SVM classifier is proposed for the Gy (x, y••
images collected by visible light cameras. First, the image is a ( x, y••• •tan - 1
Gx(x, y ••
acquired by a visible camera. Secondly, the HOG feature o f the (3••
image is calculated. Finally, the human behavior classification
is performed by the SVM classifier. The experimental results D. Count gradient histogram
show that the proposed method can effectively improve the To count the pixel gradient histogram in the image, the
recognition accuracy and calculation speed. image is divided into cells, each cell containing 8 x 8 pixels.

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

Fig. 1 Divide the gradient direction into 9 direction bins.


The gradient direction of each pixel is counted and Fig. 3 Schematic diagram of the classification problem
accumulated on the 9 bins in the histogram. For example, when
the gradient direction of the pixel falls within 80° to 1 0 0 ° 7 one For the two-category linear separable problem, a data set with
N samples is expressed as follows
is added to the fifth bin, as shown in Fig. 2. In this way, count
the direction of the pixel gradient in each cell.
T • •{(x 1 炻 • ,(
y A f e • •••••炻 • xn 炻
y^}

yN e{ + 1, - 1 }
(4••
The linear discriminated function used for classification is
g (x •• •w• Tx + b (5 ˣ

where the equation g (x•• • •0 is defined as the separation hyper


plane H to separate the two classes. The classification rule is

wTxi + b > 0 , y. • •+ 1

Fig. 2 Gradient direction histogram wTx. + b < 0 , y. = - 1


(6 ••
E. Build a gradient histogram o f the unit block Further, there is
In order to reduce the influence of illumination changes on
y,(wTx,.+b••> 1
the statistical results, the cells are combined into unit blocks. (7••
For example, a unit block contains 4 cells, that is, 16x16
In the linearly separable two-class problem, there are many
pixels. Then the gradient histogram of each block is
options for the hyperplane that can be used for classification, as
normalized. Here, a cell can be reused multiple times. That is,
shown in Fig. 4. Both the classification of the smallest interval
the same cell may be used between blocks, which mean that
classification plane in the left image and the maximum interval
there is a link between the blocks. The normalized block
classification plane in the right diagram can be used. For a two-
mainly contains three parameters: the number of cells included
class problem, the optimal solution of the classification hyper
in each block, the number of pixels in each cell, and the
plane needs to be determined.
gradient direction information of each cell. At this point, the
normalized block descriptor is the HOG descriptor.

F. Generate HOG feature descriptor


Since the block descriptor generated in the previous step
has overlapping parts, each block descriptor can be
concatenated and combined to generate an HOG feature
descriptor of the image.

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

s.t. y t (wTxi + b) > 1 - ^ t


(16••
min1lHI2
y (w7xy+b••-1 >0
s .t.
where ^ > 0 . Here, C is a penalty factor. The larger the
1 N _ value of C , the smaller the ability of the classifier to tolerate
L ( h , b , a ) = - 1H||2 - ^ a i [ y t ( H X i + b ) - 1 classification errors, and the less obvious the classification
effect on noise. The smaller the value of C , the greater the
( 1 0 ••
ability of the classifier to tolerate classification errors and the
S L ( w , b,a•• ;˧^ - ^ N

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.

You might also like