Geometric and Grayscale Template Matching for Saudi Arabian Riyal Paper Currency Recognition

ABSTRACT


INTRODUCTION
Counterfeiting has become the case in almost every country, thus motivating researchers to detect counterfeit currency based on image processing [1]- [4].For example, especially in India counterfeiting has become a critical issue.Therefore, many researchers focus on detecting the authenticity of 100, 500, and 1000 rupees based on Neural Network [5]- [10] and other image processing based methods morphologically [11]- [18].In addition to the Indian Rupee, other currencies are widely studied, including Euro [19]- [20], US Dollar [21]- [23], Saudi Arabian Riyal [22], Indonesian Rupiah [24] and Japan Yen [25].One study of the currency recognition based on image processing was a study that has been done by Sawant [26].In this study, the currency used was an Indian currency with an accuracy level approaching 90% based on 4 parameters, namely Dominant Color, Aspect Ratio, Mark ID and Latent Image.Similar research was still about the Indian currency recognition, which used the DWT algorithm for feature extraction and classification based on Probabilistic Neural Network (PNN) [27].
The result obtained by approaching both methods was quite good that was with the accuracy of 90.38%.In addition to the Indian currency recognition, which has done a lot because of its high counterfeiting crime rates, currency recognition on dollars also widely popular among researchers as studied by F. Takeda [25].In his journal, it was proposed a new technique to conduct a paper currency recognition

4231
and classification on Japan Yen and US Dollar, which was using neural networks.The NN structure coupled with the random mask method shows its effectiveness for processing data viewed from time and frequency domain.In addition to Indian Rupee and US dollar, Paper Currency Recognition (PCR) on Saudi Arabian Riyal based on the correlation between images has also been done.The method used for the classification was Radial Basis Function Network and the average accuracy level obtained was quite satisfactory that was 91.51% [28].Other research this paper referred to was PCR and classification on five currencies at once, including US Dollar (USD), Australian Dollar (AUD), Saudi Arabian Riyal (SAR), Euro (EUR), and Indian Rupee (INR) [22].In this research, pattern recognition in Region of Interest (ROI) using neural network, while the process of classification using template matching method.The system has successfully recognized 5 INR, 20 INR, 20 Euro, 50 Euro, 20 AUD and 50 AUD banknotes.Pattern recognition on 1 SAR and 5 SAR banknotes are still in process, while pattern recognition on USD banknotes was failed.Based on some of the studies presented above, PCR is still a challenging topic to study.Therefore, in this research we will study the currency recognition technique and its classification using template matching method, because based on research [22] it has successfully recognized five currencies namely USD, AUD, INR, EUR and SAR.In the previous study [28], PCR and classification of USD based on Canny Edge Detection and Template Matching obtained an average accuracy level of 95.625%.In this study, the SAR banknote is the object to be recognized and detected its authenticity with the development of the previous method, which is incorporating the Geometric Template Matching and Grayscale Template Matching.

RESEARCH METHOD
In this study, the results of edge detection using canny edge detection obtained satisfactory results as recommended by [29]- [30] it seems to produce false detection in noisy environment.Based on other references [31], canny edge detection in pre-processing gives a fairly good classification result.The next step for image smoothening process in this research is done with two approaches, which are median filter and gaussian filter.Median filtering is a non-linear digital filtering technique which is often used to reduce and even eliminate noise [29].Median filtering is often used in digital image processing because of its superiority on maintaining an edge value during noise removal process [32].Figure 1 shows an illustration of the median filtering.
Where  represents a neighbourhood centered on location.Another approach was gaussian filter, it was a smoothing technique on edge detection process [24].The equation for edge matching algorithm of the image [36] is shown on equation (2): Where (, ) represents the position of each pixels of the image and σ was the Standard Gaussian Deviation.
In image processing, Gaussian filter used was a two dimensional Gaussian filter.
Where σ represented the standard deviation of value distribution.The distribution was assumed to have an average value equal to 0. The illustration of Gaussian distribution is shown on Figure 2 and Figure 3.The second step in this research after the smoothing process was parameter optimization.Template Matching was a matching technique used in the study, template matching was often accurate by combining geometric score and grayscale score parameters.Ghazi [37] has tested the accuracy level of Geometric Template Matching (GeTeM) to detect the Dinar currency for 100 times and it has the accuracy level of 91%.GeTeM works by comparing this x value:  = 〈  〉 =1  with this x ' value:  ′ = 〈 ′  〉 =1  in time domain [38].In his paper [38], Frank mentions GeTeM needs to be considered a powerful addition to the suite of tools that a time series analyst has at their disposal for the next future work, so that in this study trials were combined between GeTeM and Grayscale Template Matching (GrayTeM) for feature extraction process.The equation of the match score itself is shown by the following equation ( 4) [36]:

RESULTS AND ANALYSIS
The system consisted of 3 main parts, namely 1) mechanical system of the scanner box the size of 18cmx10cmx15 cm to take the image of the banknote with a lighting from 4 led pieces and 180 degrees of light distribution, 2) web camera and PC that serves as the image processing system, and 3) actuator controllers which controls by assigning serial values (serial out of PC) using arduino UNO and DC motor to pull the banknote after being scanned with a webcam.The three systems are connected serially to the computer as a communication center, either as a system's database server, or as an existing actuator controller.

System Testing Scenario
To found out the best parameters that was used to test the authenticity of the banknote (PCR and its classification), the first step was to match the filter median variable X size (1, 5, 10, 15, and 20) and Y size (1, 5, 10, 15, and 20) each combination and Gaussian filter with divider parameters (d5, d10, and d15) on a number of training set of template images.After testing on the training set data, then the output was in the form of Geometric Matching Score (GeoMS) and Grayscale Matching Score (GrayMS).The values of GeoMS and GrayMS are analyzed and used as the threshold value for each banknote

Experimental Results
The process of image acquisition was done by capturing the banknote coming into the scanner box with the lighting conditions of 4 LEDs arranged into 2 x 2 LEDs.From the capture result, the system then detected the value of the number with the largest font size and then cropped it as seen in Figure 4 and Figure 5.     From PCR test to 100 sample data for each banknote value, obtained a result as shown in Table 3. From Table 3 obtained the average value of accuracy level of combining Geometric Template Matching and Grayscale Template Matching for the classification process was 95.25%.While the average value of system accuracy level in the recognition of counterfeit money on each banknote (1 SAR, 5 SAR, 10 SAR, and 50 SAR) obtained a maximum value of 100%.

CONCLUSION
In this paper, we have successfully demonstrated a PCR (Paper Currency Recognition) and its classifications test on Saudi Arabian Riyal 1 SAR, 5 SAR, 10 SAR, and 50 SAR with proposed techniques by combining Geometric Template Matching and Grayscale Template Matching methods to produce a quite satisfying result in counterfeit money recognition and the classification of its own currency.In the process of recognizing counterfeit money on each banknote system can detect 100%, while the system performance for PCR classification with the best parameters of combining GeoMS and GrayMS reached 95.25% positive recognition rate and 4.75% negative recognition rate.

Figure 1 .
Figure 1.Input and output illustration of median filter without changing the edge pixel value

Figure 6 .
Figure 6.Geometric Matching Score graph for PCR 5 SAR

Figure 7 .
Figure 7. Grayscale Matching Score graph for PCR 1 SAR

Table 1 .
1 SAR, 5 SAR, 10 SAR, and 50 SAR.From the results of the training set data test, table X and table Y each shows GeoMS and GrayMS data for PCR 1 SAR.The data were taken based on the lowest score for every 10 attempts.Based on Table 1, the threshold value of GeoMS PCR 1 SAR taken from the lowest value on the top edge column was 901,488.Similarly, the threshold value of GrayMS PCR 1 SAR based on Table 2 was 858,782.Furthermore, after GeoMS and GrayMS were obtained for each SAR PCR, a test for the classification process was conducted.Geometry Matching Score of PCR 1 SAR

Table 2 .
Grayscale Matching Score of PCR 1 SAR