Application of the Haar Classifier in Obstacle Target Detection

Aimed at obstacles on 500kV high voltage transmission lines, such as shockproof hammers, spacers and suspension clamps, a strong classifier with high recognition accuracy and fast speed is proposed in this paper by using a collection of video files, extracting Haar-like features of the target object, and combining the optimal weak classifier through a filter cascade. In the process of feature extraction, extended Haar-like features and the integral graph method with high efficiency are applied. The experimental results show that the Haar classifier can achieve high accuracy and fast speed in the detection of obstacles on high voltage transmission lines.


Introduction
In today's rapidly developing societies, the need for electricity has penetrated all aspects of life such that a high quality and reliable power supply is essential.High voltage transmission lines are the main long-distance power transmission mechanism and one of its basic requirements is security and stability.However, power lines and tower annexes are completely exposed, causing many security risks.Due to the long duration of mechanical tension, wind and sun, aging of materials, broken stock, wear, corrosion and other phenomena often arise that will cause huge losses if they are not attended to in time.That is the reason why there is a focus on research into power system disaster management in most countries around the world [1].In order to be able to identify potential problems in a timely manner, it is necessary to regularly inspect transmission lines.At present, in addition to the traditional high voltage line inspection methods, such as the artificial visual method and the helicopter aerial survey method, a most popular way is the inspection robot [2].The principle [3] is the use of a camera that is mounted on the inspection robot, shooting the pictures needed, passing them to a computer for analysis and processing, and then making them available for judgment.However, the inspection robot will inevitably encounter some attachments in the process of walking, such as shockproof hammers, spacers, and suspension clamps.It is therefore necessary to recognize these types of attachments in time to perform the relevant operation to safely cross them.
Haar-like features combined with the Adaboost classification are very successful for face detection [4][5][6].The Haar feature is a simple rectangle feature in the face detection system introduced by Viola [4] and Jones [5] and is so named because it is very similar to the Haar wavelet.A Haar-like wavelet feature and integral graph method based on the Adaboost algorithm is used to perform object detection.Viola and Jones were not the first to use the proposed wavelet feature, but they designed a more effective feature for face detection and did a cascade for the strong classifiers trained by Adaboost.A vehicle identification algorithm based on the class Haar feature and improved Adaboost classifier was designed by Xuezhi Wen et al. [7], which got good results both in training time and recognition performance.Learning from the success of the Haar classifier in the above fields and considering the specific conditions of the high voltage transmission lines, the class Haar feature and the Adaboost classification algorithm are applied to the identification and detection of shockproof hammers, spacers, and suspension clamps.The experimental results show that this method can achieve a good detection of specific objects and a satisfactory result is obtained in terms of speed and accuracy.
The whole algorithm includes two aspects: the training process and the recognition process.The training process mainly has two aspects: one is to extract the feature that plays a key role in classification detection from video images, while the other one is to prepare the Adaboost classifier for the recognition process.The recognition process firstly extracts Haar-like features from the test samples, and inputs them to the Adaboost classifier to detect the existence of the target.The algorithm structure is shown in Figure 1.

Obstacle target image training
As shown in Figure 1, the target training process mainly involves four aspects: preliminary processing of the image, integral graph calculation, Haar-like feature extraction, and Adaboost classifier training.A trained classifier detector provides Haar-like feature information and the classifier for the identification process.
Main points of the Haar classifier algorithm are as follows: 1.Using Haar-like features to perform the testing.2. Using Integral Image to accelerate the evaluation of Haar-like features.3. Using the Adaboost algorithm to train a strong classifier to distinguish between a target and non-target.4. Using filtered cascade to combine the strong classifiers to improve accuracy.

Preliminary Processing of Images and Calculation of Integral Image
Three target objects are extracted from the captured video images, with gray scale operation, and normalized to 30x30.Three kinds of target object image are shown in Figure 2. features in one window to better reflect the characteristics of the target.These entire features can only be obtained through the permutation and combination exhaustive method.However, taking the most basic four features put forward by Viola as an example, any arrangement in a window size 30 x 30 can produce at least thousands of features, and evaluation of these features requires a very large amount of calculation.However, integral graph is a fast algorithm for calculating pixels in all areas of the image based on scanning the image one time, and it can greatly improve the efficiency of image eigenvalue calculation.
Integral graph is a matrix representation method to describe global information.Integral graph is that the value ii(i,j) of the location (i,j) is constructed from the sum of the pixels in the top left corner of the original image (i,j).
Integral Figure construction algorithm [6]: 1.Let s(i,j) represent the cumulative sum of the row direction, and initialize s(i,-1)=0 2. Let ii(i,j) represents the integral image, and initialize ii(-1,i)=0 3. Scan the image line by line; calculate s(i,j) of each pixel (i,j) and the values of integral image ii(i,j) 4. Scan the image one time and when reaching the right bottom corner of the image pixels, the integral image ii(i,j) construction is done.
After constructing the integral graph, the cumulative pixel sum in any image matrix region can be obtained by a simple operation, as shown in Figure 3. Let α, β, γ, δ respectively represent D's four vertices, and the pixel sum of D can be expressed as: Haar-like feature value is the difference between the pixels sum of two matrices, and can be done in constant time.

Haar-Like Feature Extraction
Haar-like feature is defined as the difference of the summation of image pixel value in the adjacent area.It reflects the gray change of local characteristics in the image to be detected [7].We can find it from equation (4) that by introducing the concept of integral image, the extraction rate of haar-like features is greatly improved.
Viola et al. [4,5] proposed four basic rectangle features, as shown in Figure 3. Lienhart et al. [6] introduced a set of extended haar-like features, which are based on Viola's basic simple haar-like features as shown in Figure 4.This algorithm not only uses the characteristics of the horizontal and vertical direction in a rectangular area, but also rotates the rectangle area to get 45° rotated features; they also proposed a fast calculation method for the 45° rotated features.It was shown that Recognition performance of the system could be improved, while the speed of feature evaluation was not affected seriously.

Feature Selection Based on the Adaboost Classifier
The quantity of characteristic values of the object obtained by the above method is so huge that it is not possible to calculate all the features.Therefore, it is necessary to select only those features that play key roles in the classification; an effective means of doing this is to use the Adaboost algorithm.
Based on a theoretical analysis of the PAC learning model, Valiant [8] proposed the Boosting algorithm with the two important concepts of weak learning and strong learning, which laid the theoretical foundation for the subsequent adaptive Boosting algorithm named Adaboost.Weak learning is a learning algorithm whose recognition rate for a set of concepts is only a little better than random identification, whereas strong learning is a learning algorithm with a high recognition rate.To address the several drawbacks of Boosting, Freund and Schapire proposed an available and practical adaptive Boosting algorithm named Adaboost [9], whose main principle is that all samples be given an equal initial classification weighting, This is done by firstly identifying a number of weak classifiers and then, according to certain combinations, get a high recognition accuracy for strong classifiers.

Weak classifier
The original weak classifier may only include a basic Haar-like feature.By calculating the input image Haar-like characteristic value and then comparing it with the initial weak classifiers characteristic value, it can determine whether the input image is a target or not.
Each Haar-like feature can generate a classifier in the following form: Where x represents the sample, ( ) i h x represents the value of i-th Haar-like feature i h on x in the sample, ( { 1, 1} ) i i p p ∈ − + is the classification direction symbol to control the direction of inequality, i f is the classifier characterized by feature i h , and i θ is the threshold for classification i f .This kind of initial weak classifier may not be better than random judgment in terms of identification accuracy, so it is necessary to train this kind of weak classifier to obtain a relatively lower-error weak classifier known as an optimal weak classifier.
The training process for an optimal weak classifier involves looking for the right classification thresholds, so that the classifier has the lowest identification error for all samples.
The specific operations are as follows.1) For each feature f, the first job is to calculate eigenvalues for all training samples and sort them.Scan sorted eigenvalues again and calculate the following four values for each element according to the list: All target samples weight sum t1; All non-target samples weight sum t0; Target samples before this element weight sum s1; Non-target samples before this element weight sum s0.
2) The classification error for each element r is: Find the smallest value of r in the table and the corresponding element as the optimal threshold.

Strong classifier
A strong classifier is an effective combination of a number of optimal weak classifiers and its birth needs to be iterated T times.The specific operations are as follows.
1.For the training sample set S, including N samples, where X and Y respectively represent the positive samples and negative samples, T is the largest training cycles.2. Initialize the samples weight as 1 / N. 3. The first iteration, training the N samples to obtain the first optimal weak classifier (see Section 2.3.1). 4. Increase the weight for samples that were wrongly identified. 5. Place the new samples and the last turn correct identified samples together and start a new round of training.6. Execute steps 4 and 5 cyclically after the T round iterations to obtain T optimal weak classifiers.7. Combine the optimal T weak classifiers to get the strong classifiers using the following formula: ot her wi se (7) The weighted sum of the weak classifiers vote is then calculated according to the weak classifiers error rate.The sum is compared with the average voting result to find which one is better, while at the same time a strong classifier for the recognition process is formed.

The detection of target obstacle object
Recognition process is used to detect the ROI for target obstacle existence, and it includes image preprocessing, computing integral graph, extracting Haar-like features and classifying based on the Adaboost classifier.The image processing and computing integral image are similar to the training process, which extract Haar-like feature that is using Haar-like feature selected by training process which including the position, structure and type of information to calculate the corresponding Haar-like feature values and feature vector, forming the feature vectors.The Adaboost classifier uses the feature vectors to detect obstacle target existence for under identifiable ROI, and then output the final classification test results.

Result and analysis of the detection
According to the images of the same obstacle acquired by the moving robot at different distances and from different perspectives, we chose the more representative images as the input samples.As an example, for shockproof hammers we choose 1500 positive sample images and selected 100 images as the test sample, while randomly selecting 3500 negative sample images that had been removed from the target.Some of the negative sample images are shown in Figure 6.We use a similar method to select samples for spacers and suspension clamps.
For each of the target obstacles we trained a respective classifier and then used the test sample to test the trained classifier.The recognition accuracy and speed is shown in Table 1 while the examples of identification results are shown in Figure 7.As can be seen from the experimental results, the classifier trained by using Haar-like feature and the Adaboost algorithm can detect the predetermined object effectively: shockproof hammer, spacer, suspension clamp.The accuracy and speed of detection are within the desired range and generally good results have been obtained.

Conclusion
Drawing on the successful application of the Haar classifier for face detection, this paper proposes an obstacle recognition method based on Haar-like features and the Adaboost algorithm for 500kv high voltage transmission line shockproof hammers, spacers, and suspension clamps.We first calculated the Haar-like features of the image using the integral graph method, and then trained the extracted feature set by applying the Adaboost algorithm, and finally obtained a classifier with high recognition accuracy and fast speed.The experimental results show that this method can achieve very good results in obstacle detection on high voltage transmission lines.

Figure 2 .
Figure 2. Three kinds of obstacle image

Figure 3 .
Figure 3. Calculating the cumulative pixel sum in any image matrix region

Figure 3 .
Figure 3. Four basic rectangle features

Figure 5 .
Figure 5. Examples of Haar-like features

Figure 6 .
Figure 6.Example of negative sample

Table 1 . Experimental result The type of obstacle accuracy rate/% Time /ms
Figure 7. Examples of identification results Unauthenticated Download Date | 6/22/19 5:47 PM