1

LOOP Descriptor: Local Optimal Oriented Pattern

arXiv:1710.09317v2 [cs.CV] 2 Feb 2018

Tapabrata Chakraborti, Brendan McCane, Steven Mills and Umapada Pal

Abstract—This letter introduces the LOOP binary descriptor
(local optimal oriented pattern) that encodes rotation invariance
into the main formulation itself. This makes any post processing
stage for rotation invariance redundant and improves on both
accuracy and time complexity. We consider fine-grained lepidoptera (moth/butterfly) species recognition as the representative
problem since it involves repetition of localized patterns and
textures that may be exploited for discrimination. We evaluate
the performance of LOOP against its predecessors as well as
few other popular descriptors. Besides experiments on standard
benchmarks, we also introduce a new small image dataset on NZ
Lepidoptera. Loop performs as well or better on all datasets
evaluated compared to previous binary descriptors. The new
dataset and demo code of the proposed method are to be
made available through the lead author’s academic webpage and
GitHub.
Keywords—Local Binary Patterns, Collaborative Representation,
Local Optimal Oriented Pattern (LOOP), Fine-grained Recognition.

I. I NTRODUCTION
Local binary descriptors have been shown to be effective
encoders of repeated local patterns for robust discrimination
in several visual recognition tasks [1]. He and Wang [2], in
their seminal paper on the subject, introduced the concept of
textons. These encode localized textures/patterns in an image
into binary words, and the frequency histogram of these words
describes the image. The first popular implementation was
local binary pattern (LBP) by Ojala et al [3].
Since then, many interesting modifications and improvements of these descriptors have been developed. A few of
these are modified census transform (MCT) [4], local gradient
pattern (LGP) [5], local directional pattern (LDP) [6], uniform
local binary pattern (ULBP) [17], etc. LBP encodes the local
intensity variation in the 3 × 3 neighborhood of each image
pixel into a binary word, the decimal equivalent of which then
acts as a representative feature encapsulating the pattern of
local intensity variation in that neighborhood. The histogram
of the LBP values over all pixels of an image serves as the
descriptor for that image. MCT [4] is a modified version
of LBP, where instead of taking the central pixel intensity
of the neighborhood as the threshold, the average intensity
over the entire neighborhood is treated as the threshold while
forming the binary word. LGP [5] considers the gradient of
neighboring pixel intensities with respect to the central pixel
intensity to generate the binary word. Both MCT and LGP
Tapabrata Chakraborti, Brendan McCane and Steven Mills are with the
Department of Computer Science, University of Otago, NZ.
e-mail: tapabrata;mccane;steven at cs.otago.ac.nz.
Umapada Pal is with the Computer Vision and Pattern Recognition Unit at
the Indian Statistical Institute.
e-mail: umapada at isical.ac.in.

were demonstrated to be more robust to noise than the original
LBP operator [5],[6]. LDP was proposed by Jabid et al. [6] as
a more noise invariant alternative to LBP. It incorporates the
outputs of the 3 × 3 Kirsch masks in 8 directions, for each
pixel, into a binary word and its corresponding decimal value
is the desired LDP value, corresponding to that pixel.
An inherent shortcoming of both LBP and LDP, as well as
many of the other related descriptors like MCT, LGP, etc., is
that each assigns an ad hoc bias while sequencing the generated
binary digits to form the binary word. This is because the
choice of the initial pixel of this circular sequence of bits
determines the binary-to-decimal conversion weight assigned
to each of the binary digits, as explained later in the paper. This
adds an inherent rotation variance. A few rotation invariant
versions have also been suggested in existing literature, like
LDPri [16] for LDP. But these have their own set of limitations
and the present work presents an alternative rotation invariant
scheme.
The main contributions of this paper are:
1) LOOP descriptor: We encapsulate rotation invariance
into the main formulation of local binary descriptor,
thus overcoming a drawback of most existing descriptors of the genre. In the process we decrease post
processing time complexity and increase accuracy of
classification. The demo code for LOOP will be made
available through the lead author’s GitHub account.
2) NZ Lepidoptera dataset: We present a new finegrained image dataset of NZ Lepidoptera. Small finegrained datasets can have significant real life applications, like native/endemic species recognition and biodiversity analysis. It is difficult to effectively train deep
networks on such small specialized datasets, and hence
fine-tuned approaches like the present one still have
practical significance. The dataset will soon be available
at the lead author’s academic webpage.
Note that though we have shown the efficacy of the proposed
method on butterfly and moth species recognition, the methodology may be applied to other similar applications exhibiting
repeated local patterns/textures.
II.

P REVIOUS D ESCRIPTORS

A brief review of LBP and LDP is presented here, since
the proposed LOOP descriptor is an improvement designed on
them.
A. Local Binary Pattern (LBP)
LBP [3] is a popular descriptor which captures the local
intensity variation patterns of an image and has good discrimination characteristics.

2

Let ic be the intensity of an image I at pixel (xc , yc ) and
in (n = 0, . . . , 7) be the intensity of a pixel in the 3 × 3
neighborhood of (xc , yc ) excluding the center pixel ic .
Then the LBP value for the pixel (xc , yc ) is given by
LBP (xc , yc ) =

7
X

s(in − ic ).2n

(1)

n=0

where


s(x) =

if x ≥ 0
otherwise

1
0

(2)

A major disadvantage of LBP is the arbitrary sequence of
binarization weights. Depending on the chosen starting pixel
of the sequence of binary weights (2n , n = 0, . . . , 7), the 8
neighbors of the output 3 × 3 grid are allocated subsequent
weightage n sequentially. There is no clear logic behind
the proper assignment of weight and the result obtained is
susceptible to rotation variance. The same pattern rotated
between images of the same class or even within different
parts of the same image will generate a different binary word,
thereby confounding the classification process. In fact, this bias
has persisted over to other related descriptors as well, like LDP,
MCT, LGP, etc.
B. Local Directional Pattern (LDP)
LDP is an improved local pattern descriptor which incorporates a directional component by using Kirsch compass kernels.
It was shown to be less susceptible to noise than the traditional
LBP operator [6].
Let ic be the intensity of an image I at pixel (xc , yc ) and
in , n = 0, 1, . . . , 7 be the intensity of a pixel in the 3 × 3
neighborhood of (xc , yc ) excluding the center pixel ic . 3 × 3
Kirsch edge detectors centered at (xc , yc ) in eight possible
directions are given in Fig. 1.
The 8 responses of the Kirsch masks are mn , n = 0, . . . , 7
corresponding to pixels with intensity in , n = 0, . . . , 7 and
let mk be the k th highest Kirsch activation. Then all the
neighboring pixels having Kirsch response higher than mk is
assigned 1, and others 0.
But the empirically assigned value of k is ad hoc [6]. This
fixes the possible number of ones to k −1 and number of zeros
to (n + 1 − (k − 1) = n − k + 2 where n is as defined above by
the neighborhood pixel number. Hence the possible number of
n+1
binary words is reduced from 2(n+1) to Ck−1
.
Then the LDP value for the pixel (xc , yc ) is given by
LDPk (xc , yc ) =

7
X

s(mn − mk ).2n

as in previous formulations. Thus it assigns an emperical rule
to the starting point of the binary word construction. However,
it suffers from the self-imposed restriction of always having a
leading 1, which immediately reduces the number of available
combinations in the binary word by half. The problem of fixed
number of 1s and 0s also persists from the original LDP,
depending on the value of the threshold k.
III. P ROPOSED M ETHODOLOGY
The proposed Local Optimal Oriented Pattern (LOOP) is
described here in details.
A. Local Optimal Oriented Pattern (LOOP)
As discussed earlier, the major disadvantage of LBP and
LDP is the arbitrary sequence of binarization weights that adds
dependancy to orientation. LDP also suffers from the empirical
assignment of value to the threshold variable, which puts an
ad hoc restriction on the number of bits allowed to be 1, thus
reducing the number of possible words, as discussed before.
LOOP presents a non-linear amalgamation of LBP and LDP
that overcomes these drawbacks while preserving the strengths
of each.
Let ic be the intensity of an image I at pixel (xc , yc ) and
in (n = 0, 1, . . . , 7) be the intensity of a pixel in the 3 × 3
neighborhood of (xc , yc ) excluding the center pixel ic . The 8
Kirsch masks, as used in LDP previously, are oriented in the
direction of these 8 neighboring pixels in (n = 0, 1, . . . , 7)
thus giving a measure of the strength of intensity variation in
those directions, respectively.
This leads us to propose the incorporation of this information by assigning the binarization weight to each neighboring
pixel corresponding to the strength of Kirsch output in the
direction of that pixel. The underlying rationale behind this
approach is that the Kirsch mask output in a particular direction
provides an indication of the probability of occurrence of an
edge in that direction. Since the LBP indicates the intensity
variation over the neighboring pixels in the same directions, the
value of the Kirsch output is employed to assign the decimalto-binary weightage.
As discussed earlier, the 8 responses of the Kirsch masks
are mn corresponding to pixels with intensity in , n = 0, . . . , 7
Each of these pixels are assigned an exponential wn (a digit
between 0 and 7) according to the rank of the magnitude of
mn among the 8 Kirsch mask outputs.
Then the LOOP value for the pixel (xc , yc ) is given by

(3)

LOOP (xc , yc ) =

n=0

where


s(x) =

1
0

7
X

s(in − ic ).2wn

(5)

n=0

if x ≥ 0
otherwise

where
(4)

Rotation Invariant LDP (LDP ri ): A rotation invariant
version is introduced in [16]. Here the neighbor pixel with
highest Kirsch mask output is assigned the highest order in
the binary word, and then the other bits are taken sequentially


s(x) =

1
0

if x ≥ 0
otherwise

(6)

Thus the LOOP descriptor encodes rotation invariance into
the main formulation. Moreover, the proposed LOOP algorithm also negates the empirical assignment of the value of
the parameter k in the traditional LDP method (eqn. 3).

3

(a) Admiral

(b) Blue

(c) Copper

(d) Ringlet

(e) Erebidae

(f) Geometridae

(g) Hepialidae

(h) Noctuidae

Fig. 2: Sample images from each class of the new NZ Lepidoptera dataset. It has 640 images currently with 80 images per
class. (a)-(d) are butterfly species & (e)-(h) are moth species.

IV.

Fig. 1: Numerical Example to calculate LBP, LDP and LOOP.

B. Scale and Rotation Invariance
A multi-scaled amalgamated histogram is constructed to
achieve scale-independence. This is done by forming a spatial
gaussian pyramid and then concatenating the histograms of
LOOP values obtained at each scale to form the final histogram
which acts as the descriptor for the image.
Figure 1 illustrates the rotation invariance property of LOOP
descriptor, compared to the lack thereof in LBP and LDP. As
demonstrated in Figure 1, binary words are formed according
to LBP rule and the weights are assigned according to the LDP
mask activations.
Tie break in weight assignment: Referring to Figure 1,
the one with more differing nearest neighbour is assigned
higher weight. Eg. For the two -2155 for pattern 2, the nearest
neighbours for one are -2155 and -275 (difference is 1880)
while nearest neighbours for the other are -2155 and -2035
(difference is 120). So the former is assigned higher weight
than latter (21 vs. 20 ).

E XPERIMENTS AND R ESULTS

A. Experimental Setup
Datasets. 3 image datasets of moth and butterfly species
have been used to showcase the performance of the methods.
Leeds butterfly dataset [7] was built in 2009 at the University
of Leeds, UK. It contains 832 images of 10 species of
butterflies with 55 to 100 images per catagory.
Ponce butterfly dataset [8] was built by the Ponce Group at
Beckman Institute, University of Illinois at Urbana-Champaign
in 2004. It has 7 butterfly types with a total of 619 images.
The smallest class contains 42 images and the largest class has
111 images.
NZ Lepidoptera dataset is a new benchmark built during
this work at the Department of Computer Science, University
of Otago, NZ in collaboration with the CVPR Unit, Indian
Statistical Institute. It has 8 classes of NZ butterflies and
moths, 4 categories each. Currently it has 640 images with 80
images per class, subject to expansion in near future. Images
of NZ moths have been compiled from the publicly available
database of NZ Landcare Research. Sample images of the NZ
Lepidoptera dataset are presented in Figure 2.
Classifiers. The collaborative representation classifier
(CRC) [9] has been shown recently to be effective in handling
small fine-grained datasets where the differences in objects
between classes is subtle compared to randomized significant
background variation within and between classes [10]. CRC
represents the test image as an optimal weighted average of
training images of all classes and the subsequent residual per
class is used to calculate the predicted category. We adopt a
recent Probabilistic formulation of CRC called ProCRC [11].
For comparison with a popular off-the-shelf classifier, a
support vector machine (SVM) [12] with a χ2 kernel is
chosen with settings as in the ProCRC paper [11] for fair
comparison. Multiclass categorization is performed with the
binary SVM classifier in a one-versus-all fashion in turns.

4

TABLE I: Classification Accuracy (%)
Leeds

(a) Sample image

(b) LOOP output

Fig. 3: Standard test image (rice.png) and the LOOP output.

Descriptors. We compare the performance of several local
binary pattern encoders like LBP, MCT, LDP, LDPri , LGP
with the proposed LOOP descriptor. Among these, LOOP is
built influenced by LBP and LDP, while MCT and LGP are
chosen as relevant modifications of these methods. LDPri is
a rotation invariant modification of LDP. We also compare
with three popular modern binary descriptors: BRIEF (Binary Robust Independent Elementary Features) [13], BRISK
(Binary Robust Invariant Scalable Keypoints) [14], and ORB
(Oriented FAST and rotated BRIEF) [15]. BRIEF was the
first of these and presents a simple configuration similar to
LBP, without rotation invariance. ORB descriptor is rotation
invariant and uses an optimal sampling pair. BRISK has both
of these attributes and also has the additional characteristic of
a more advanced hand-crafted sampling pattern composed of
concentric rings.
B. Results and Discussion
For each dataset, experiments are conducted with 5 fold
cross validation and percentage classification accuracies are
presented in Table 1 with the highest accuracy in each column
highlighted in bold. The LOOP output on a standard test image
’rice.png’ is presented in Figure 3 as an illustrative example.
It is observed that LOOP performs much better than LBP
and LDP, the two descriptors on which it is based. Performance
of LOOP is also better than the competing LBP variants: MCT,
LGP and LDPri . LOOP successfully outperforms BRIEF,
but has comparable results with BRISK and ORB, both of
which are rotation invariant. However, LOOP has a simpler
formulation and lower execution time than ORB and BRISK.
Using the standard tic-toc functionalities of MATLAB, it is
observed that ORB and BRISK have 21% and 27% higher
computation time respectively than LOOP.
Among the competing classifiers listed in Table1, only
LDPri , BRISK and ORB are rotation invariant. LOOP yields
comparable results to BRISK and ORB, but has lower run
time due to simpler formulation. LOOP yields only marginal
improvement in performance compared to LDPri , but has
similar complexity in formulation and comparable run time.
We determine whether the increase in average accuracy of
LOOP over LDPri is statistically significant.

Ponce

NZ

SVM

ProCRC

SVM

ProCRC

SVM

ProCRC

LBP

62.1

64.7

68.4

70.5

55.6

59.3

MCT

63.9

65.8

69.9

72.3

58.7

61.1

LDP

66.6

68.5

71.7

74.1

60.9

64.5

LDPri

69.2

72.5

75.1

77.9

64.8

68.3

LGP

69.4

72.9

75.0

77.6

64.2

68.6

BRIEF

65.5

67.1

70.4

73.6

59.9

63.0

BRISK

69.8

73.5

77.7

79.3

66.2

69.5

ORB

71.0

73.8

78.4

79.9

65.8

70.1

LOOP

71.5

74.4

78.3

80.4

66.0

70.6

Sign Binomial Test. For each descriptor, we have 2 classifiers and 3 datasets, hence 6 combinations per descriptor. Also
there are 5 fold cross-validation per combination. So for each
descriptor we have 30 sets of accuracy results. Assuming the
null hypothesis to be that the two competing methods (LOOP
and LDPri ) are equally good, then there is 50% chance of each
beating the other.
It is observed that of the 30 experimental runs, LOOP
outperforms LDPri 22 times. The one-tail P value at 5% level
of significance is 0.0081. Now using Bonferroni correction, at
5% level of significance, the corrected α for the 6 combinations
(2 classifiers and 3 datasets per descriptor) is 0.05/6 = 0.0083.
Since the calculated chance is 0.0081 (less than the corrected
α), we can reject the null hypothesis and conclude that LOOP
has a statistically significant better performance than LDPri .
Also as explained earlier, LDPri has the constraint of always
having a leading 1 thus halving the number of possible words,
along with the restriction of having a fixed number of 1s and
0s in the binary word. LOOP is free from these limitations
design.
V.

C ONCLUSION

A novel binary local pattern descriptor, LOOP, which overcomes some disadvantages of its predecessors LBP and LDP, is
presented. It is tested on Lepidoptera species recognition with
encouraging initial results that warrant further exploration. It
outperforms the descriptors on which it is based, along with
a few other variants. It has comparable results with popular
binary descriptors like BRISK and ORB, but gains in time
complexity.
A new benchmark dataset of NZ Lepidoptera images is also
introduced. The proposed method may be used in similar finegrained applications with small datasets, where fine-tuning a
deep network is difficult.
The present letter has only presented experiments and results
on one representative problem, that of Lepidoptera classification. But LOOP is a generalized binary descriptor and may be
used in further research for other small fine-grained datasets
where it is difficult to train deep convolutional networks.

5

R EFERENCES
[1]

[2]

[3]

[4]

[5]

[6]
[7]

[8]
[9]
[10]

[11]

[12]
[13]
[14]
[15]
[16]

[17]

D. Huang, C. Shen, M. Ardabilian, Y. Wang, and L. Chen, “Local Binary
Patterns and Its Application to Facial Image Analysis: A Survey,” IEEE
Trans. on Systems, Man and Cybernetics- Part C, vol. 41, no. 6, pp. 765781, Nov 2011.
DC. He and L. Wang, “Texture Unit, Texture Spectrum, And Texture
Analysis,” IEEE Trans. on Geoscience and Remote Sensing, vol. 28, pp.
509 - 512, 1990.
T. Ojala, M. Pietikinen, and D. Harwood, “Performance evaluation of
texture measures with classification based on Kullback discrimination of
distributions,” In Proc. ICPR, 1994.
B. Frobaand and A. Ernst, “Face Detection with the Modified Census
Transform,” In Proc. IEEE Conf. on Face and Gesture Recognition, pp.
9196, May 2004.
B. Jun and D. Kim, “Robust face detection using local gradient patterns
and evidence accumulation,” Pattern Recognition, vol. 45, no. 9, pp.
3304-3316, Sep. 2012.
T. Jabid, M. H. Kabir, and O. S. Chae, “Gender Classification using
Local Directional Pattern (LDP),” In Proc. ICPR, 2010.
J. Wang, K. Markert, and M. Everingham, “Learning Models for Object
Recognition from Natural Language Descriptions,” In Proc. BMVC,
2009.
S. Lazebnik, C. Schmid, and J. Ponce, “Semi-Local Affine Parts for
Object Recognition,” In Proc. BMVC, 2004.
L. Zhang, M. Yang, and X. Feng, “Sparse Representation or Collaborative
Representation: Which Helps Face Recognition?,” In Proc. ICCV, 2011.
T. Chakraborti, B. McCane, S. Mills, and U. Pal, “Collaborative
representation basedfine-grained species recognition,” In Proc. IVCNZ,
2016.
S. Cai, L. Zhang, W. Zuo and X. Feng, “A Probabilistic Collaborative
Representation based Approach for Pattern Classification,” In Proc.
CVPR, 2016.
C. Cortes and V. Vapnik, “A support vector networks,” Machine
Learning, vol. 20, no. 3, pp. 273297, Sept 1995.
M. Calonder, V. Lepetit, C. Strecha, and P. Fua, Brief: Binary robust
independent elementary features, In Proc. ECCV, 2010.
S. Leutenegger, M. Chli, and R. Y. Siegwart, BRISK: Binary robust
invariant scalable keypoints, In Proc. ICCV, 2011.
E. Rublee, V. Rabaud, K. Konolige, and G. Bradski, ORB: an efficient
alternative to SIFT or SURF, In Proc. ICCV, 2011.
T. Jabid, M. H. Kabir, and O. S. Chae, “Local directional pattern
(LDP)A robust image descriptor for object recognition,” Proc. IEEE
Conf. on Advanced Video and Signal Based Surveillance (AVSS), 2010.
Y. Ming, G. Wang, C. Fan, “Uniform Local Binary Pattern Based
Texture-Edge Feature for 3D Human Behavior Recognition”, Plos One,
vol. 10, no. 5, pp: 1-15, 2015.

