Partial Matching for Livestock Brand Image Recognition Waldemar Villamayor-Venialbo and Horacio Legal-Ayala Laboratorio de Computaci´ on Cient´ ıfica y Aplicada Universidad Nacional de Asunci´ on, Campus Universitario, San Lorenzo, Paraguay wvenialbo@pol.una.py, hlegal@pol.una.py Abstract This work introduces a novel approach to perform partial match- ing of digital images. The method was devised to help measuring shape similarity for a Cattle Brand Registration System we de- veloped the past year. The main contribution is twofold. First we present a technique that allows the use of methods designed for the extraction of global invariants to generate lo- cal invariant features. After decomposing a shape in their basic elements, local features are obtained from components formed by taking account the relative spatial distribution of the shape’s elements. The set of these local features determines a unique identifier for a given shape. Second, the formulation of a ex- clusion measure function depending on those sets of local shape features. This exclusion measure helps to determine if a shape could be considered a subset of another given shape. Experi- mental results have shown the accuracy of the methodology. Problem Formulation and Challenges The correct registration of cattle brands is a major issue in countries with an old ranching tradition due to large brand image databases. Brand inspector officers must prevent frauds ensuring that a particular brand cannot be converted in another brand by adding some extra components to its design. The challenge consists in identifying candidate brands that may include or be included in existing brand designs, i.e., retrieve from the database any registered brand that could be converted in the candidate brand, or vice-versa. The method should be efficient to manage large number of livestock brands. The proposed partial matching scheme is based on a set exclusion measure function, and its formulation relies on the compar- ison of descriptors, obtained by decomposing the brand in characterizing components. Figure 1: Cattle Brand Registration System. Using Global Invariants as Local Shape Descriptors Figure 2: Matching brand components. To perform the decomposition, a nat- ural choice is to consider the primitive strokes forming the cattle brand as the working elements. However, match- ing brands by only taking account each individual stroke, separately, is not enough to distinguish two brands with similar design. The adopted solution consists in using pairs of strokes as brand components. Descriptor values computed from the union of two strokes, preserving their posi- tion relative to each other, will be enough to distinguish both brands in Fig. 2. Set of descriptors of a brand: Considering a brand F ⊂ R 2 , let f i ∈ F represents the i-th stroke in that brand. The set of descriptors of F is defined as: S F : = N −1 i=1 N j =i+1 I (f i ∪ f j ) , N> 1 , (1) where I : F → R n is some global shape feature extractor operator and N is the number ∗ of strokes in F . Best association: Let S F and S G represent the descriptor sets of brands F and G. Consider the collection P FG of injective correspondences with the form: P FG = { (x, y ) | x ∈ S F ,y ∈ S G } . (2) If ‖·‖ is some norm (e.g., the L 2 norm) in the descriptor space R n , the linear combination of the distances between each pair (x, y ) ∈ P FG given by d(P FG ) : = (x,y )∈P FG ‖x − y ‖ , (3) will be minimum for the best pairing of members in S F and S G . I.e., if Q FG ∈ P FG contains the best pairing of members in S F and S G , then, d(Q FG )= min P ∈P FG d(P ) . (4) ∗ We do not consider here the trivial case when N =1, i.e., a brand composed uniquely of one isolated stroke. Experimental Results Table 1: Intraclass retrieval performance Alteration P R S.E. A. Displacement 0.971 0.971 13.3% Rotation 0.977 0.970 18.1% Scaling 0.946 0.902 13.7% Stretching 0.988 0.952 14.9% Shearing 0.992 0.992 16.2% Combined 0.973 0.954 16.5% B. Add-in 0.980 0.918 3.7% Add-on 1.000 1.000 0.0% Partial 1.000 1.000 12.4% Rejection 1.000 1.000 N.A. ❄ θ =0.004 ✂ ✂ ✂ ✂ ✂ ✍ θ =0.006 ❆ ❆ ❆ ❆ ❑ θ =0.008 ❍ ❍ ❍ ❍❨ θ =0.01 θ =0.02 θ =0.03 θ =0.04 θ =0.05 θ =0.1 1.0 0.9 0.8 0.8 0.9 1.0 Recall Precision Figure 3: Overall retrieval performance. Partial Matching using Set Exclusion Criteria Set exclusion criteria: To determine if a brand contains, or it is contained in another brand, an exclusion measure M : R 2 × R 2 → [0, 1] is formulated. Let m and n be the number of elements in S F and S G , respectively, we define: M (F, G) : =1 − 1 r r i=1 χ i , r = min(m, n) , (5) Figure 4: Values of M (F, G) in various scenarios. where the characteristic operator χ i is: χ i : = 1, if ‖x i − y i ‖≤ θ, 0, otherwise , (6) (x i ,y i ) ∈ Q FG , ‖·‖ is as in (3), and θ ≥ 0 is a parame- ter determining the threshold to consider similar two corresponding components. Measuring exclusion: The set exclu- sion measuring function (5) can yield any value from Table 2. Table 2: Contingency of the set exclusion measure M (F, G) Exclusion value Relation M (F, G)=0 ⇒ F ⊆ G ∨ F ⊇ G 0 <M (F, G) ≤ 1 ⇒ F G ∧ F G Example Results Figure 5: Identifying brand’s elements. Figure 6: Real working example. Bibliography Chen, J., Sato, Y., Tamura, S.: Orientation space filtering for multiple orientation line segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence [PAMI] 22(5) (2000) 311–317 Rahtu, E., Salo, M., Heikkil¨ a, J.: Affine invariant pattern recognition using multi-scale autoconvolution. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI) 27(6) (2005) 908–918 Villamayor-Venialbo, W., Legal-Ayala, H.: Stroke segmentation from livestock brand images. In: Proceedings of the 35th Conferencia Latinoamericana de Inform´ atica [CLEI]. (2009) Villamayor-Venialbo, W., Legal-Ayala, H., Justino, E., Facon, J.: Partial matching using set exclusion criteria: Applied to livestock brand retrieval. In: Proceedings of the 23rd Brazilian Conference on Graphics, Patterns and Images [SIBGRAPI]. (2010) 178–185 LCCA – Facultad Polit´ ecnica – Universidad Nacional de Asunci´ on, Campus Universitario, San Lorenzo, Paraguay http://www.fpuna.edu.py/