GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

Viola–Jones object detection framework

The Viola–Jones object detection framework is a machine learning object detection framework proposed in 2001 by Paul Viola and Michael Jones. It was motivated primarily by the problem of face detection, although it can be adapted to the detection of other object classes. In short, it consists of a sequence of classifiers. Each classifier is a single perceptron with several binary masks (Haar features). To detect faces in an image, a sliding window is computed over the image. For each image, the classifiers are applied. If at any point, a classifier outputs "no face detected", then the window is considered to contain no face. Otherwise, if all classifiers output "face detected", then the... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

The Viola–Jones object detection framework is a machine learning object detection framework proposed in 2001 by Paul Viola and Michael Jones. It was motivated primarily by the problem of face detection, although it can be adapted to the detection of other object classes. In short, it consists of a sequence of classifiers. Each classifier is a single perceptron with several binary masks (Haar features). To detect faces in an image, a sliding window is computed over the image. For each image, the classifiers are applied. If at any point, a classifier outputs "no face detected", then the window is considered to contain no face. Otherwise, if all classifiers output "face detected", then the window is considered to contain a face. The algorithm is efficient for its time, able to detect faces in 384 by 288 pixel images at 15 frames per second on a conventional 700 MHz Intel Pentium III. It is also robust, achieving high precision and recall. While it has lower accuracy than more modern methods such as convolutional neural network, its efficiency and compact size (only around 50k parameters, compared to millions of parameters for typical CNN like DeepFace) means it is still used in cases with limited computational power. For example, in the original paper, they reported that this face detector could run on the Compaq iPAQ at 2 fps (this device has a low power StrongARM without floating point hardware). At run time, a given image I is tested on f_1(I), f_2(I), ... f_k(I) sequentially. If at any point, f_i(I) = 0 , the algorithm immediately returns "no face detected". If all classifiers return 1, then the algorithm returns "face detected". For this reason, the Viola-Jones classifier is also called "Haar cascade classifier". f_{w, b}(I) = \begin{cases} 1, \quad \text{if } \sum_{x, y}w(x, y)I(x, y) + b > 0 \\ 0, \quad \text{else} \end{cases} A Haar feature classifier is a perceptron f_{w, b} with a very special kind of w that makes it extremely cheap to calculate. Namely, if we write out the matrix w(x, y) , we find that it takes only three possible values \{+1, -1, 0\} , and if we color the matrix with white on +1 , black on -1 , and transparent on 0 , the matrix is in one of the 5 possible patterns shown on the right. Each pattern must also be symmetric to x-reflection and y-reflection (ignoring the color change), so for example, for the horizontal white-black feature, the two rectangles must be of the same width. For the vertical white-black-white feature, the white rectangles must be of the same height, but there is no restriction on the black rectangle's height. Choose a resolution (M, N) for the images to be classified. In the original paper, they recommended (M, N) = (24, 24) . To use a Viola-Jones classifier with f_1, f_2, ..., f_k on an image I , compute f_1(I), f_2(I), ... f_k(I) sequentially. If at any point, f_i(I) = 0 , the algorithm immediately returns "no face detected". If all classifiers return 1, then the algorithm returns "face detected". h(\mathbf{x}) = \sgn\left(\sum_{j=1}^M \alpha_j h_j (\mathbf{x})\right) Each weak classifier is a threshold function based on the feature f_j . h_j(\mathbf{x}) = \begin{cases} -s_j &\text{if } f_j The threshold value \theta_j and the polarity s_j \in \pm 1 are determined in the training, as well as the coefficients \alpha_j . Here a simplified version of the learning algorithm is reported: Input: Set of positive and negative training images with their labels {(\mathbf{x}^i,y^i)} . If image is a face y^i=1 , if not y^i=-1 . Initialization: assign a weight w^i_{1}=\frac{1}{N} to each image . For each feature f_j with j = 1,...,M Renormalize the weights such that they sum to one. Apply the feature to each image in the training set, then find the optimal threshold and polarity \theta_j,s_j that minimizes the weighted classification error. That is \theta_j,s_j = \arg\min_{\theta,s} \;\sum_{i=1}^N w^i_{j} \varepsilon^i_{j} where \varepsilon^i_{j} = \begin{cases} 0 &\text{if }y^i = h_j(\mathbf{x}^i,\theta_j,s_j)\\ 1 &\text{otherwise} \end{cases} Assign a weight \alpha_j to h_j that is inversely proportional to the error rate. In this way best classifiers are considered more. The weights for the next iteration, i.e. w_{j+1}^i , are reduced for the images that were correctly classified. Set the final classifier to h(\mathbf{x}) = \sgn\left(\sum_{j=1}^{M} \alpha_j h_j(\mathbf{x})\right) f = the maximum acceptable false positive rate per layer. d = the minimum acceptable detection rate per layer. Ftarget = target overall false positive rate. P = set of positive examples. N = set of negative examples. F(0) = 1.0; D(0) = 1.0; i = 0 while F(i) > Ftarget increase i n(i) = 0; F(i)= F(i-1) while F(i) > f × F(i-1) increase n(i) use P and N to train a classifier with n(i) features using AdaBoost Evaluate current cascaded classifier on validation set to determine F(i) and D(i) decrease threshold for the ith classifier (i.e. how many weak classifiers need to accept for strong classifier to accept) until the current cascaded classifier has a detection rate of at least d × D(i-1) (this also affects F(i)) N = ∅ if F(i) > Ftarget then evaluate the current cascaded detector on the set of non-face images and put any false detections into the set N. The cascade architecture has interesting implications for the performance of the individual classifiers. Because the activation of each classifier depends entirely on the behavior of its predecessor, the false positive rate for an entire cascade is: F = \prod_{i=1}^K f_i. Similarly, the detection rate is: D = \prod_{i=1}^K d_i. Thus, to match the false positive rates typically achieved by other detectors, each classifier can get away with having surprisingly poor performance. For example, for a 32-stage cascade to achieve a false positive rate of , each classifier need only achieve a false positive rate of about 65%. At the same time, however, each classifier needs to be exceptionally capable if it is to achieve adequate detection rates. For example, to achieve a detection rate of about 90%, each classifier in the aforementioned cascade needs to achieve a detection rate of approximately 99.7%. An improved algorithm on Viola-Jones object detector Citations of the Viola–Jones algorithm in Google Scholar - Adaboost Explanation from ppt by Qing Chen, Discovery Labs, University of Ottawa and a video lecture by Ramsri Goutham.

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Viola–Jones object detection framework". 1788222703. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1372519967

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·