LBP & More Slides from Dr. Shahera Hossain Pixel Neighborhood-based Feature • The most important for texture analysis is to describe the spatial behavior of intensity values in any given neighborhood. • Different methodologies have been proposed. • Local binary pattern (LBP) is one of the most-widely used approach – mainly for face recognition. • LBP is used for texture analysis too. Local Binary Pattern (LBP) For each PIXEL of an image, a BINARY CODE is produced ο to make a new matrix with the new value (binary to decimal value). π−1 π ππ − ππ 2π πΏπ΅ππ,π ππ = π=0 where, neighborhood pixels ππ in each block ο is thresholdedby its center pixel value ππ pο sampling points (e.g., p = 0, 1, …, 7 for a 3x3 cell, where P = 8) r ο radius (for 3x3 cell, it is 1). Binary threshold function π π₯ is, 0, π₯<0 π π₯ = 1, π₯≥0 Computation of Local Binary Pattern Binary code for > Nc 3 7 2 8 4 1 2 3 5 0 1 0 1 Nc 0 0 0 1 Component-wise multiplication 0 2 0 128 ? 0 0 0 16 ∑ Sum LBP 146 Representation Neighborhood of a gray-scale image 1 2 4 128 8 64 32 16 Example of how the LBP operator works top Computation of LBP (LSB) 0 Binary Pattern: 1 (MSB) Code/Weight 2π : 1 x 27 1 x 26 1 x 25 1 x 24 0 x 23 = 128 LBP: 1 = 64 1 = 32 1 = 16 0 0 1 (LSB) 0x 22 0x 21 1 x 20 =0 =0 =1 0 =0 1 + 0 + 0 + 0 + 16 + 32 + 64 + 128 = 241 A New Method: DCLBP • A new method called diagonal-crisscross local binary pattern (DCLBP) for texture representation is proposed recently. • Basic concept: An image feature should take diagonal pixel variations as well as horizontal and vertical (crisscross) pixel variations in the neighborhood, so that it can perform well even in the cases of rotations in images. • Two other variants of the LBP, considering rotational feature & mean/median of the neighbor pixels are also proposed • These are compared with LBP, median-LBP, interpolationLBP, number-LBP, neighborhood-intensity-LBP. Diagonal-Crisscross Local Binary Pattern (DCLBP) (a) N1 – N5 N0 – N4 (b) N2 – N6 (LSB) N3 – N7 (c) (d) top Diagonal-Crisscross Local Binary Pattern (DCLBP)… a) 3x3 image patch b) Start from N0 pixel position c) Get differences for front-diagonal values (N0 – N4), in vertical direction (N1 – N5), for back-diagonal direction (N2 – N6), and in horizontal direction (N3 – N7) 1 1 3 5 7 d) Multiply each difference with 2 , 2 , 2 and 2 sequentially to 35 7 compute a new value e) Take the mean value of newly-computed value and the central pixel value Diagonal-Crisscross Local Binary Pattern… π·πΆπΏπ΅ππ,π ππ = π −1 π=0 π πΏπ,|π|+π × 2ππ ∈π + ππ 2 where, Sampling-point set is, π = 1, 3, 5, 7 Cardinality of the set is, π = 4 Difference parameter πΏ is, πΏπ,|π|+π = ππ − π|π|+π The binary threshold function π πΏ is, 0, πΏ<0 π πΏ = 1, πΏ≥0 p0 = 21 p1 = 23 p2 = 25 p3 = 27 Diagonal-Crisscross Local Binary Pattern… Here, the cardinality, π = 4 that demonstrates that it has 4 differentpossible values as ‘21, 23, 25 and 27’. when π = 0, we get πΏ0,4+0 × 21 = πΏ0,4 × 21 which, covers the front-diagonal difference of π0 − π4 . Similarly, when π = 1, πΏ1,5 × 23 covers the vertical difference of π1 − π5 ; when π = 2, πΏ2,6 × 25 covers the back-diagonal difference of π2 − π6 ; when π = 3, πΏ3,7 × 27 covers the horizontal difference of π3 − π7 . Through this manner, we get the new central pixel value for each patch. Median-RILBP ∝ πΏπ΅ππ,π ππ = ππππππ π πΏπ΅ππ,π ππ , π |π=0,1,…,π−1 where, • ∝ symbolizes ‘rotational-invariant’ nature; • π is pattern (e.g., 8 for a 3x3 patch); • π is radius (1 for 3x3 patch); • Rho (π ) is the rotational function where it circularly does bitwise right-shift operation. • π is 8 when if π = 8. so 8 times rotation • The bit-shift is done 8 times if π = 8. The concept here is to rotate the πneighbors. • Finally, compute the ππππππ value that the neighbor chain may represent. Mean-RILBP ∝ πΏπ΅ππ,π ππ = ππππ π πΏπ΅ππ,π ππ , π |π=0,1,…,π−1 where, • ∝ symbolizes ‘rotational-invariant’ nature; • π is pattern (e.g., 8 for a 3x3 patch); • π is radius (1 for 3x3 patch); • Rho (π ) is the rotational function where it circularly does bitwise right-shift operation. • π is 8 when if π = 8. so 8 times rotation • The bit-shift is done 8 times if π = 8. The concept here is to rotate the π neighbors. • Finally, compute the MEAN value. Experiment: Dataset 1 Figure: Sample images for each class of USC-SIPI Rotated Textures dataset. Figure: Seven rotated images for bark class (USC-SIPI Rotated Textures dataset). Experiment: Dataset 1 – USC-SIPI DB • USC-SIPI (i.e., University of Southern California – Signal and Image Processing Institute)) Rotated Textures dataset • Each image is digitized at seven different rotation angles: 0, 30, 60, 90, 120, 150, and 200 degree for each of the 13 different images • These images are taken from the Brodatz database which is the most widelyused dataset USC-SIPI Database Total classes 13 No. of images per class 7 Rotations 7 Image size 512x512 pixels Total images 91 Experiment: Dataset 2 Ten different classes for KTH-TIPS dataset (sandpaper, crumpled aluminum foil, styrofoam, sponge, corduroy, linen, cotton, brown bread, orange peel and cracker B) Experiment: Dataset 2 – KTH-TIPS Database • KTH-TIPS (TIPS stands for ‘Textures under varying Illumination, Pose and Scale’) database. KTH-TIPS Database Total classes 10 No. of images per class 81 Rotations & variations 81 Image size 200x200 pixels Total images 810 Classification • Lets employ – K-nearest neighbor classifier (KNN) & – Multi-class support vector machine (SVM) (radial basis kernel function, gamma = 1). We consider 10-fold cross-validation Recognition Results – 1 USC-SIPI Database Total classes 13 No. of images per class 7 Rotations 7 Image size 512x512 Total images 91 USC-SIPI Rotated Textures DB Feature KNN SVM LBP 46.0 74.7 Interpolation_LBP 46.1 80.2 Median_LBP 30.8 80.2 MedianR_LBP 84.6 93.4 Number_LBP 92.3 87.9 NI_LBP 23.1 65.9 Mean-RILBP 100 95.6 Median-RILBP 92.3 96.7 DCLBP 100 90.1 Recognition Results – 2 KTH-TIPS Database Total classes 10 No. of images per class 81 Rotations & variations 81 Image size 200x200 Total images 810 Feature LBP KTH-TIPS DB KNN 80 Interpolation_LBP Median_LBP MedianR_LBP Number_LBP NI_LBP Mean-RILBP Median-RILBP DCLBP 60 70 70 90 70 70 70 90 SVM 53.7 53.1 46.4 28 35.2 55.7 23.4 29.6 72.5 top Thank you very much for your kind attention