# An Improved MB-LBP Defect Recognition Approach for the Surface of Steel Plates
## 4 Experiment and Analysis of Surface Defects Detection Based on MB-LBP
### Experimental Design
#### 4.1.3 Experiment of Defect Feature Extraction and Defect Classification in this Paper  
In this paper, MB-LBP was employed in feature extraction and support vector machine (SVM) was employed in the defect classification and identification.  
The complete experiment process is shown in Figure 13.  
The process of the MB-LBP + SVM experiment is detailed as follows:  
1. Image division  
The image is divided into small blocks with n \(\times\) n (n = 2, 4, 8, and so on) pixels, and then the mean gray value of the blocks are calculated as the gray value of the block.  
Figure 12: Division of difference with high and low threshold.  
Figure 13: Feature extraction based on support vector machine (SVM).  
2. MB-LBP pattern value calculation For each block, compare its gray value to each of its eight neighbors clockwise. When the gray value of center block is 50% greater than the gray value of neighbor block, write \"0\". Otherwise, write \"1\". This gives an 8-digit binary number, which is usually converted to decimals for convenience.
3. Feature vector generation Now, we have binary numbers of all blocks in the entire image. Then, compute the histogram of the frequency of each \"binary number\" occurring in the entire image. An 8-digit binary number has 2\({}^{8}\) = 256 different numbers at most. Therefore, this histogram can be seen as a 256-dimensional feature vector. Such a large number of patterns will result in a long calculation time. Furthermore, a large pattern number will lead to a sparse feature vector that is difficult to compute. To solve these two problems, referring to the LBP uniform pattern [24], we proposed the MB-LBP uniform pattern. This idea is motivated by the fact that some binary patterns occur more commonly in texture images than in others [25]. These common binary patterns are called a uniform pattern if the binary pattern contains at most two 0-1 or 1-0 transitions. For example, 00010000 (two transitions) is a uniform pattern, 01010100 (six transitions) is not. Other uncommon binary patterns are called a non-uniformed pattern if it contains more than two transitions. The maximum MB-LBP uniform patterns is 59, much smaller than 256 of the original MB-LBP. Figure 14 shows the comparison of the histogram between the original MB-LBP and MB-LBP uniform pattern.
4. The generated feature vectors are sent to the SVM for classification and identification The original SVM is a binary classifier. In this paper, the one-vs-one multi-classification SVM method [26] was adopted. Every two classes construct a SVM, and there are a total of n(n - 1)/2 SVM. The parameter n is the number of classes. In this paper, n = 5 and there were 5(5-1)/2 = 10 SVM in total. The specific construction process is as follows: 1. Select two image classes, \(i\) and \(j\) in the training set as the positive and negative sample sets; 2. Extract the MB-LBP features of all images in class \(i\) and \(j\), then represent all images by the histogram vector; 3. Train the classifier between class \(i\) and \(j\); 4. Repeat steps (a)-(c) until the training between any two classes is completed. Obtain the optimal classification surface of all classifiers.  
Figure 14: The comparison of the histogram between the original LBP and LBP uniform pattern.  
When a test image I is classified, vote to determine which class the image I belongs to according to the minimum sum of the distances from image I to the optimal classification surface.