An algorithm for Peruvian counterfeit Banknote Detection based on Digital Image Processing and SVM

A R T I C L E I N F O A B S T R A C T Article history: Received: 21 December, 2020 Accepted: 30 January, 2021 Online: 25 February, 2021 In this work we propose an algorithm for Peruvian counterfeit banknotes detection. Our algorithm operates in banknotes with 50, 100 and 200 soles denominations that were manufactured from 2009 onwards. This algorithm offers an automatic diagnosis based on digital image processing and support vector machines (SVM). Current Peruvian counterfeit detection systems are specially designed to analyze relevant characteristics in dollars and euros. Then, some counterfeiters can fool these systems. We made our detection system robust because we focus on the image acquisition and the segmentation of intaglio marks engraved over the banknotes. After segmentation, we applied embossing and Sobel filters followed by an aperture morphological operation to obtain special characteristics that were then classified by an SVM. We have validated our methodology using real and fake banknotes from a dataset of 240 samples provided by Central Reserve Bank of Peru (BCRP). Our final identification accuracy was 96.5%.


Introduction
In order to properly introduce the proposed algorithm, it's been divided into three sections: motivation and incitement, literature review and contribution.

Motivation and incitement
In Peru, counterfeiting money is a well-known fraud method. In fact, according to the Central Office Against Counterfeiting Money from Peru, the amounts of fraudulent banknotes have reached millionaire quantities (Oficina Central de Lucha contra la Falsificación de Numerario -OCN -Peru: "Principales operativos contra la falsificación" Available: http://www.ocn.gob.pe). As a result, the annual report of the United States Secret Service, an entity with which the Peruvian National Police works together to combat national and foreign banknote counterfeiting, places Peru as the main banknote counterfeiter country worldwide, surpassing other South American countries such as Colombia , which had this title before.
In Peru, this type of practice is especially problematic and constitutes an attack on society, because it makes people to lose trust on currency in circulation which increases money transaction time. Even worse, this distrust in Peruvian money hurts the economic growth and, in the long term, it could also lead to inflation because, as there is more money circulating than the amount the government can handle, people purchasing power increases, which would turn into an increase in prices. Finally, this ends up affecting the economy of any person or any company that receives the fradulent banknotes, especially when those banknotes are the ones with the highest denomination.
In this context, some enterprises offer solutions in the form of counterfeit banknote detectors. However, most of these detectors are based on foreign banknote manufacturing technologies, such as the "Elwic BC 3500 UV / MG next-generation banknote counter" or "PREZZOPAZZO DST-38D banknote detector", which use verification parameters such as magnetism, infrared or banknote thickness, all of which have already been fooled by Peruvian banknotes counterfeiters.
A common method used by scammers is to discolorate lowdenomination banknotes (i.e. 10 or 20 soles banknotes), and then overprint them with high-denomination banknote values (i.e. 50, 100 or 200 soles banknote values). These overprints can be of very high detail so they successfully fool the aforementioned verification parameters used by commercial detectors. However these type of techniques are less common on lower denomination banknote (10 and 20 soles) as they would be less cost effective.
Our algorithm focuses on intaglio marks which are distinctive for Peruvian banknotes and whose imitations have not reached such a high level of sophistication. ASTESJ ISSN: 2415-6698 * The focus of the algorithm is on the higher denomination banknotes (50, 100 and 200 soles) since these are the more commonly counterfeited and the more damaging to the victims. Some other commercial detectors are aimed to serve more as inspection tools for the user, using ultraviolet lights or magnifying glasses as is in the case of "Elwic Professional Banknote Detector IRD-2200" or the "Anizun Magnifying glass mini microscope". These solutions do not provide a clear detection verdict. Rather, they are based on users' prior knowledge of the distinctive marks and details that a legitimate banknote must have. By relying on the human senses, these methods have an intrinsic error. Furthermore, counterfeiters are capable of mimicking several of the most distinctive characteristics of authentic banknotes, such as fluorescent markings or some images that give the illusion of being seen against the light (Arjowiggins Security. "Security features: Watermarks, security fibres and security threads" Available: https://securitypapers.arjowiggins.com). Compared to these detection tools, our method offers a clear and readable verdict on the denomination and legitimacy of the analyzed banknote.
Another common counterfeit technique used in Peruvian banknotes is the removal of security bands from 100 and 200 soles banknotes. These bands are manually removed from a legitimate banknote and placed on a falsified one, then the legitimate but damaged banknote can be exchanged for a new one in banks. This way, counterfeiters have a fake one with a security band that would pass even a meticulous examination. Our algorithm can tackle this problem as it uses banknotes intaglio marks that cannot be removed and placed in falsified ones.

Literature review
We reviewed various scientific publications related to banknote analysis.
For example in [1] and [2] the authors tackled the automatic banknote denomination recognition problem by using digital image processing techniques. However in our proposed algorithm we not only determine banknote denomination but, in addition, perform a procedure aimed to identify the veracity of the banknote by analyzing intaglio marks with digital image processing techniques.
On the other hand, in [3] and [4] the authors were concerned about banknotes veracity but did not contemplate the use of an enclosure to standardize image light conditions. In comparison, our proposed solution does use an enclosure to ensure uniform illumination across all processed training and validation images.
Publications such as [5] and [6] that are based on digital image processing techniques have some flaws, as they did not consider the use of supervised learning algorithms to solve the classification task. On the contrary, our proposed solution uses a support vector machine (SVM) to tackle the classification problem after a training process performed with labeled images.
Some recent publications include the use of artificial intelligence [7] and deep learning [8] to detect counterfeit currency. However, these algorithms were designed and tested to work on other currencies such as dollars, euros, etc. Its performance on peruvian banknote has not been tested and they don't use the intanglio marks as a classification parameter, which is the most difficult detail to forge.
Likewise, convolution techniques and neural networks are used in [8] which demand a lot of computational load and therefore requires to be implemented in hardware boards such as Jetson TX2. In contrast, we propose a low complexity algorithm that can be easily implemented on a small single-board computer (such as Raspberry Pi 3) with very satisfactory results.

Contribution and paper organization
Given that intaglio marks (Banco Central de Reserva del Perú, BCRP: "Elementos de seguridad de los billetes de 100 soles", Available: http://www.bcrp.gob.pe) are banknotes difficult-tofalsificate features we decided to design an algorithm that analyzes them (see Figure 1 for a view of some intaglio marks). In order to analyze intaglio marks we capture banknote images using a digital camera and an enclosure to guarantee proper light conditions. These images are then analyzed and enhanced using image processing techniques and a support vector machine (SVM) to determine whether the image corresponds to a legitimate or a fake banknote. Thus, our proposed system offers an automatic diagnostic on the veracity of the banknote analyzed. Taking all these considerations into account, our methodology was able to perform a 96.5% of detection over the image dataset comprising 240 banknotes provided by the Central Reserve Bank of Peru (BCRP).
The amount of 240 samples was the result of the source of information provided by the Central Reserve Bank of Peru.
The selection of these samples had the following filters.
• The number of samples for the indicated denominations is reduced to 2 groups. • The first group is confirmed by banknotes that did not enter into circulation, i.e., that did not deceive people. • The second group of banknotes belongs to the group that entered circulation, i.e. the user did not detect the counterfeit banknote at the beginning.
For the validation process the second group was selected. In this case, BCRP specialists selected the banknotes that presented the greatest difficulty in detecting counterfeits. The details of the proposed algorithm, the results of the tests and the conclusions will be described in the following sections.

Proposed algorithm
For a better understanding, the distinctive characteristics of Peruvian banknotes will be first described and then a discussion of the main blocks of our algorithm will be presented.

Banknotes characteristics
We will focus our analysis on the intaglio marks from 50, 100 and 200 soles banknotes (Banco Central de Reserva del Perú, BCRP: "Nuevos billetes de 50, 100 y 200 soles", Available: http://www.bcrp.gob.pe). These marks can be appreciated by the human eye only if banknotes are positioned as in Figure 2 and with good illumination conditions. These marks depend on the banknote denomination, for this reason it is important to first determine the banknote denomination before proceeding with the analysis of intaglio marks.
In Figure 3 we present the block diagram of the proposed algorithm. In the following sections we will describe each block.

Image acquisicion
We used a closed enclosure to control light conditions, the enclosure was illuminated by a 3W white light LED. To capture the intaglio marks, every picture was taken from the right side of the banknote obverse. The sample banknotes are placed into the enclosure using mechanical guides that help with their correct and quick placement. LED lights were positioned so the area of interest would be distinguished more clearly.
A Raspberry v1 camera was used to take the picture, this camera has a CMOS OmniVision OV56476 with 5 megapixels (2592 x 1944 pixels resolution). The banknotes region of interest has RGB format (true color, 24 bits per pixel). Each primary component is defined as ( , ) , ( , ) and ( , ) , where ( , ) are the spatial coordinates.
All the computations were made by the Raspberry Pi 3B + single board computer which is compatible with the camera used and can perform all the required processing steps in less than 3 seconds with low power consumption (5 V /2.5 A). The acquired image is set to M=1644 rows and N=2592 columns.
In Figure 4 we showed 50, 100 and 200 soles banknotes taken under the described conditions.

Banknote classification by denomination
Given the captured images, we defined three regions of interest that were fixed so we can identify relevant characteristics in each banknote. These regions of interest can be expressed as: 1 ( , ) = ( + 400, + 500) 1 ( , ) = ( + 400, + 500) where: = 0,1, … , 600 = 0,1, … , 500 where: = 0,1, … , 519 = 0,1, … , 699 where: = 0,1, … , 519 = 0,1, … , 1024 These regions were chosen because they allow us to differentiate between banknotes denomination by their coloration (See Fig. 5 for an example in a 200 soles banknote). We averaged color components in every region of interest as features. To compute these averages, we use the following equations: where M1 = 601 and N1 = 501 where M2 = 520 and N2 = 650 where M3 = 520 and N3 = 1025 We compound this averages in a feature vector 1 defined as: The compound feature vector 1 is then classified using a Support Vector Machine (SVM) with a radial basis function kernel [10]. This kernel, which is described as a Gaussian function, was chosen because of its high performance to classify nonlinear data, as it is in our case. SVM was selected as the classifier because of its better performance compared with other techniques like KNN and because of its robustness to classify nonlinear data [11]. We used 70% of the banknotes for training and 30% for testing. We obtained a 99% of accuracy in this task as will be detailed in the results section.

Counterfeit banknote detection
After banknote classification by denomination, we now proceed to determine if the banknote is false or legitimate. To do so, we first isolate a counterfeit detection region of interest per banknote denomination as follows: where: = 0,1, … , 500 = 0,1, … , 255 In Figure 6, we zoom in these regions of interest.
After the selection of the counterfeit detection region of interest, we compute averages in each component using the following equations: Every color component is then enhanced using an embossing filter [12] which is designed according to the banknote denomination, as is shown in equations (32), (33) and (34).
We then obtain the filtered components 4′ ( , ) , 4′ ( , ) and 4′ ( , ) which have highlighted textures as can be seen in Figure 7. To magnify edges, we applied Sobel filters [13] over the embossing components. In the case of the one-hundred banknote, we used a sobel variation filter due to the diagonal orientation of intaglio marks in this banknote.
After this step, we obtain as results 4′′ ( , ) , 4′′ ( , ) and 4′′ ( , ). Sobel filters are designed to sharp edges and variations [14], as we can see in Figure 8. Now, the components are binarized using a threshold that varies with the banknote denomination [15]. Since constant illumination conditions are guaranteed, constant thresholds are used for each denomination in the binarization process. The resulting components are expressed using the following equations: The binarization process allowed us to reduce information from grayscale images [16]. Instead of an 8-bit image, now we have a 1-bit image, as seen in Figure 9. After this, we filtered the results using the aperture morphological operation. We do this to eliminate some noisy elements and enhance visibility of objects of interest (intaglio marks) [17]. Structuring elements are designed depending on the banknote denomination as follows. Thus, we obtain new image components ′′′ , ′′′ and ′′′ . Figure 10 shows some results.
We then apply connectivity 4 to count the number of objects in each component. The number of objects per component are denominated 4 , 4 y 4 . We use these values to create a new compound feature vector 2 as follows: This feature vector is classified using an SVM trained per each banknote denomination (i.e. we used 3 SVMs). Thus, we used independent hyperplanes to perform our classification for our 6dimensional vector [18]. Again, we used a radial basis function kernel [11] and 70% of the banknotes for training and 30% for testing. Figure 10: Results after aperture morphological operation using specially designed structural elements.

Results
In this section we present our results for the classification and detection tasks using our 240 banknote dataset which are distributed as shown in Table 1. The ground-truth veracity of the banknotes was determined by a specialist of the BCRP.
Result for the banknote classification by denomination task are presented in Table 2. As we used 70% of the data to train the SVM classifier these results correspond to the remaining 30%. To compute our performance metric we divide the number of correct results by total number of samples.
As we can see, the results from this step were almost perfect, we only had one mistake in the classification of a one-hundred soles banknote.
In Table 3 we show the results for the detection process. Results obtained in the detection process are satisfactory. There was only one mistake on a 50 soles banknote and another one on a 100 soles banknote.   In Tables 4, 5 and 6, we show correct and incorrect detections of the true and false banknote by denomination. In Table 4, a legitimate 50 soles banknote was incorrectly detected as false. This was caused by a deteriorated banknote that was bent on several places. In Table 5, a legitimate 100 soles banknote was incorrectly detected as false. This was caused by an incorrect insertion of the banknote on the image acquisition zone.   The average performance (according with Table 3) is then 97.47%. We observed that mistakes were generated because of banknote positioning problems (they were not inserted correctly or maybe the banknote was bent so its image could not be acquired correctly).
According to Table 3, the average detection performance of the proposed algorithm is 97.47%. The detection errors were mainly generated by banknote positioning problems, i.e. the banknotes were not inserted correctly or perhaps the banknote was bent, so its image could not be acquired correctly.
These problems could be solved by the use of additional hardware or by training the SVM classifier with images with these imperfections.
Finally, the total effectiveness of our algorithm P (A) (including classification and detection) is computed using the following equation: where P (B) is the percentage of correct classifications, P ( C B ⁄ ) is the percentage of correct detections given a correct classification. Table 7 summarizes our final results.
Then, the total effectiveness average is 96.5%, which are results that could improve with a bigger sample. Compared to other studies with different currencies, it reached a higher percentage than Ballado's (95%) [6] and a lower percentage than Han's (100%) [7].

Conclusions
The proposed algorithm was able to identify the denomination and veracity of Peruvian banknotes that were manufactured from 2009 onwards using the intanglio marks as a deciding factor, and support vector machines (SVM). The practical operation of this algorithm was validated by specialists from the Central Reserve Bank of Peru (BCRP). The few cases in which the algorithm failed were caused by the deteriorated state of the banknote. It is suggested not to use banknote that is ripped or folded in order to avoid missreadings.
Our automatic algorithm was efficient and can be used by any user who needs to determine the veracity of Peruvian 50, 100 or 200 soles banknotes.
The algorithm was entirely developed in Python and was embedded into a Raspberry single board computer. Additionally, does not consume high computational resources.
As we increase the number of training samples we can improve SVM performance for classification.

Conflict of Interest
The authors declare no conflict of interest.