Machine Learning is a rapidly growing Haar Classifier is a supervised classifier, it has mainly been used for facial detection but it can also be trained to detect other objects. Computer vision is such a growing field that there are so many resources available for your own personal use. OpenCV provides a lot of functionality for machine learning techniques and the Haar Classifier is one of them. I thought this could potentially be good for use in recognition of solar cavities, because of its robustness, ease of use, built in basic OpenCV functionality and I found that it runs a lot faster than other techniques I tried to implement.
The Haar Feature supported by OpenCV is an object detector initially proposed by Paul Viola and Michael Jones in Rapid Object Detection using a Boosted Cascade of Simple Features
Example rectangle features shown relative to the enclosing detection window. The sum of the pixels which lie within the white rectangles are subtracted from the sum of pixels in the black rectangles. Two-rectangle features are shown in (A) and (B). Figure (C) shows a three-rectangle feature, and (D) a four-rectangle feature.
This technique harbors on the concept of using features rather than pixels directly. Which can then be easier to process and gain domain knowledge from correlating feature sets. It has also proven to be exceptionally faster than that of pixel relation systems
The first and second features selected by AdaBoost.
The two features are shown in the top row and then overlayed on a typical training cavity in the bottom row. The first feature measures the difference in intensity between the region of the top portion with the region right below. The feature capitalizes on the observation that the top region is often darker than lower parts of the cavity (a gradient). The second feature compares the intensities in the middle regions to the intensity across the outer edges of the cavity.
A Haar Classifier is really a cascade of boosted classifiers working with haar-like features. Haar-like features are specific adjacent rectangular regions at a specific location in a window (as shown in the first image above). The difference is then used to categorize subsections of an image and separates the non-objects from objects. Due to this distinction it is more of a weak learner, where you must use a large number positives to get as many Haar-like features as possible to accurately describe an object with some type of correlation and accuracy. So with all of these essentially weak classifiers we combine them into our classifier cascade to hopefully form a strong learner, by way of boosting.
Boosting is the concept of creating a set of weak learners and combining them to make a single strong learner. In the implementation of detecting solar cavities I used the AdaBoosting algorithm (aka Adaptive Boosting). This algorithm was initially proposed by Yoav Freund and Robert Schapire in A Decision-Theoretic Generalization of on-Line Learning and an Application to Boosting. It is used to improve a learning algorithms performance, by calling weak classifiers repeatedly and updating weights.
OpenCV currently supports multiple variations of AdaBoost including Discrete Adaboost, Real Adaboost, Gentle Adaboost and Logitboost.
Tags: Haar Classifier, thesis