Cattle identification using muzzle print images based on feature fusion

Individual identification of animals is an important means to modernize the livestock industry. In recent years, the research on individual identification of cattle has also received more and more attention. Individual cattle identification is necessary for many important reasons including registration, traceability, production management and animal disease control. Biometric features are unique, which often do not change over time. In this paper, muzzle print is used as biometric feature. The fusion of texture features extracted from Weber Local Descriptor(WLD) and local binary pattern was used to represent individual cattle. Some improvements were made to WLD algorithm. Finally, support vector machine was employed to identify head of cattle from their fusion feature. The proposed method achieved 96.5% identification accuracy.


Introduction
Animal individual identification has received a great research attention as an important way to achieve modern management of the livestock industry. Identification of cattle can apply to the variety of applications, such as registration, traceability, production management and animal disease control. To identify cattle, different traditional methods were used such as tattoos, ear notching, hot iron branding, plastic ear tags and Radio Frequency Identification(RFID) tags. Tattoos, ear notching and hot iron branding can cause great pain to cattle and are not permanent methods as they can be altered or removed over time. Ear tags have been found to be vulnerable to damage, duplication, loss and replacement [1]. RFID tags have certain reliability and security, but RFID systems also have security flaws such as tag content changes and system fraud possibility. Therefore, biometric identification has become a new choice. Biometric recognition not only ensures accuracy, but also provides high security. Nowadays, human fingerprint recognition has been widely used, and has a very high accuracy. Muzzle print is similar to a human's fingerprint and muzzle print of different animals of the same species are mostly unique [2]. Cattle muzzle print has rich texture characteristics. The oval, rounded or irregular structures are called "beads", and slender straight lines or curves are known as "ridges" [3]. Initially, people used ink to collect muzzle print images. This method has disadvantage such as inconvenient and time inefficient process, special skills to control the animal. It is difficult to obtain good-quality muzzle print. Nowadays, the muzzle photos are used as input data for cattle identification.  [4] used the Speeded Up Robust Features (SURF) to extract the features of the muzzle print images. Experiments on the data set of eight head of cattle showed that the accuracy was higher than 90% with sufficient training data. In 2013, Awad et al. [5] used Scale Invariant Feature Transform (SIFT) to detect the key points of muzzle print texture, and Random Sampling Consistency (RANSAC) to remove outliers. They achieved 93.3% accuracy of cattle identification. The approach also improved the reliability and robustness of the algorithm. In 2014, Tharwat et al. [6] applied local binary pattern(LBP) to describe local features. The linear discriminant analysis (LDA) was used to address high dimensionality problem. The authors used different methods including nearest neighbors, naive Bayes, support vector machine(SVM), and K nearest neighbors to identify cattle. Experimental results showed that support vector machine achieved the best classification effect. In 2016, Gaber et al. [7] proposed a method for identifying cattle based on Weber Local Descriptor (WLD). They used WLD method to extract the characteristics of muzzle print texture and the Adaboost classifier to classify the features. The experimental results showed that the identification accuracy was 99.5%. In 2018, Kusakunniran et al. [8] proposed a cattle individual identification method based on feature fusion. The author extracted Gabor features in different scales and specific frequency directions, extracted LBP histogram for each local sub-image and fused Gabor features and LBP features. Experimental results showed that this method achieved high accuracy. In this paper, two kinds of descriptors, local binary pattern [9] and improved WLD method are used to extract texture features. Then, The two features are fused and classified by SVM. The gray information of image can be obtained by LBP operator, while differential excitation and gradient direction value can be provided by WLD. The rest of the paper is organized as follows. Section 2 describes our proposed approach in detail. Experimental results and discussion are introduced in Section 3. Finally, conclusions are summarized in Section 4.

Proposed method
The flow chart of the individual identification algorithm of cattle is shown in Figure 1, which mainly includes image preprocessing phase, feature extraction phase, feature fusion phase and recognition phase. After building the database, the images are processed into grayscale images. The next step is to extract features from each muzzle print image, based on the fusion of LBP and improved WLD. Finally, support vector machine is used as the classifier for identifying the ID of individual cattle.

Feature extraction
There are two kinds of feature to extract, including local binary pattern and Weber Local Descriptor.

Local binary pattern(LBP)
LBP is an operator used to describe local features of an image. It has illumination invariance and robustness to image rotation. The idea of LBP technology is to assign a label to every pixel of an image by thresholding the 3×3 neighborhood of each pixel with the center pixel value and considering the result as a binary number [10]. If the intensity of the center pixel is greater than (or equal to) the intensity of the neighboring pixel, the label is set to 1 at the corresponding position; otherwise, it is set to 0. The basic formula of LBP is: is the gray value of center pixel and is the value of neighbor pixel.

Weber local descriptor
Weber local descriptor is a local image descriptor proposed by Chen jie et al. [11] in 2009.It is inspired by Weber's law. The difference threshold of the sense changes with the change of original stimulus, and it shows a certain regularity. The ratio of the stimulus increment (∆I) to the original stimulus value (I) is a constant. Weber local descriptor consists of two parts, differential excitation and gradient direction.

Differential excitation
Differential excitation compares the difference between the center pixel and the neighbor pixel, which reflects the intensity information of local gray variation. Firstly, filter is used to calculate the sum of the differences between the current pixel and its adjacent pixel gray values, and the calculation formula is as follows: Where ( ) is the i-th adjacent pixel of the center pixel , and is the total number of adjacent pixels around it.
is calculated by the filter , it's actually the value of the current pixel . Figure 3 shows the calculation process of differential excitation.

Improved weber local descriptor
In the WLD feature, the method only considers the current 4 neighboring pixels when calculating the gradient direction.It will lose some discriminative details and are also susceptible to noise interference. In this paper, the Scharr operator is used to calculate the gradient direction. It takes into account all  Figure 7. The image processed by Scharr operator After the differential excitation and gradient direction are calculated, two-dimensional WLD histogram can be obtained. In order to make the feature discrimination of WLD stronger, the twodimensional histogram is further transformed into the one-dimensional histogram. In order to express the spatial structure characteristics of the image, the image is divided into m(R 1 ,R 2 ..., R m ) blocks. Then, the histogram information of each block is calculated to obtain the histogram features and connect them to form the characteristic of the muzzle print image.

Data normalization and feature fusion
The LBP method acquires the grayscale information of the image, and the WLD method obtains the differential excitation and gradient information of the image. A single feature does not fully reflect the texture information, so the LBP histogram feature is combined with the WLD histogram feature. After feature extraction, z-score is used for standardized processing to make the data within the interval of [0,1],and the features are concatenated to obtain the feature vectors.

Classification
The final critical step in cattle individual identification is classification. Support vector machine (SVM) is a new generation of learning algorithm developed on the basis of statistical learning theory, which has a better generalization ability for test samples that have not been seen . Since most problems are nonlinear and separable, kernel functions of SVM can map low-dimensional space to highdimensional space. Therefore, kernel functions turn SVM into nonlinear classifier, and SVM is selected for classification in this paper.

Experimental environment
The experiment in this paper is completed under the Windows 7 operating system, the host memory is 4.0 GB, the CPU is a 4-core i5-3470, and the main frequency is 3.2 GHz.

Experimental results
In this paper, there are 900 pictures in the data set. In order to eliminate the interference of random results, the following data are the average results obtained by repeating 10 experiments under the same conditions. The performance of both WLD histogram and LBP histogram is affected by the number of sub-regions. As shown in Table 1, the recognition rates of the LBP descriptor, the WLD method and the fusion method in the case where the image is divided into 4×3, 5×5, 6×8,10×10 sub-regions are shown respectively .The support vector machine is used for identification. As can be seen from the table, the recognition rate of the algorithm is improved by integrating the features extracted from LBP descriptor and WLD method. The number of sub-regions of the image has a great influence on the performance of the algorithm. For LBP algorithm and WLD algorithm, the recognition rate is the highest when the image is divided into 5×5.The recognition rate increases first and then decreases as the number of sub-images increases. As the number of blocks increases, the statistical information of each small histogram becomes smaller, which affects the recognition effect.
In order to select an appropriate cattle individual recognition algorithm, the performance of SVM was compared with that of decision tree and KNN , and the feature fusion of LBP feature and WLD feature was selected for identification. The specific experimental results are shown in table 2.   From table 3, it can be seen that when the test images are rotated with different angles, the recognition accuracy is similar to that of the non-rotated images. This proves that our method is robust against any rotations in the image.

Conclusion
In this paper, improved Weber Local Descriptor and local binary pattern are applied to extract the feature, and the SVM, decision tree and KNN algorithm are used for recognition. A single feature cannot fully reflect the texture information, so the LBP feature is integrated with the WLD feature. Experiments show that the feature fusion algorithm has a good effect on accuracy. Compared with the decision tree and KNN algorithm, SVM has the best recognition effect and can be used to study the individual identification of cattle. Although the current algorithm recognition accuracy has reached more than 96%, it still needs to be improved. In the future, it is necessary to increase the number of pictures in the database and evaluate whether the algorithm proposed in this paper will get good results.