Automated Coin Recognition System Using ANN: Shatrughan Modi Dr. Seema Bawa
Automated Coin Recognition System Using ANN: Shatrughan Modi Dr. Seema Bawa
Electromagnetic method based systems In our work we have combined Hough Transform and Pattern
Averaging to extract features from image. Then, these features
Image processing based systems are used to recognize the coins. In section 3 implementation
The mechanical method based systems use parameters like details are given. In section 4 we have presented training and
diameter or radius, thickness, weight and magnetism of the coin testing data. Then, in section 5 the experimental results are
to differentiate between the coins. But these parameters can not provided. Then, in section 6 we have concluded the work.
be used to differentiate between the different materials of the
coins. It means if we provide two coins one original and other 3. IMPLEMENTATION DETAILS
fake having same diameter, thickness, weight and magnetism Coin recognition process has been divided into seven steps. The
but with different materials to mechanical method based coin architecture of Automated Coin Recognition System is shown in
recognition system then it will treat both the coins as original Fig. 1.
coin so these systems can be fooled easily.
13
International Journal of Computer Applications (0975 – 8887)
Volume 26– No.4, July 2011
3.2 Conve rt RGB Coin Image to Grayscale Fig. 5: Cropped Image Fig. 6: 100×100 Trimmed
From the first step the image we got is a 24-bit RGB image. Image
Image processing of colored images takes more time than the
grayscale images. So, to reduce the time required for processing 3.5 Generate Pattern Averaged Image
of images in further steps it is good to convert the 24-bit RGB The 100×100 trimmed coin images become the input for the
image to 8-bit Grayscale image. trained neural network. But to reduce the computation and
complexity in the neural network these images are further
3.3 Remove Shadow of Coin from Image reduced to size 20×20 by segmenting the image using segments
In this step, shadow of the coin from the Grayscale image is of size 5×5 pixels, and then taking the average of pixel values
removed. As all the coins have circular boundary. So, for within the segment. This can be represented by mathematical
removing shadow Hough Transform for Circle Detection [9] is equations, as shown in (1) and (2):
used. For this first of all edge of the coin is detected using Sobel 5 5
Edge Detection. Following is the pseudo code for Hough Sumi Pijk
Transform: j 1 k 1
Step 1. Define a 3-dimensional Hough M atrix of (M × N × …(1)
R), where M , N is the height and width of the Sumi
Grayscale image and R is the no. of radii for which SegAvgi
25 …(2)
we want to search.
where i, j, k is the segment no., row no. and column no. of a
Step 2. For each edge pixel (x, y) and for particular radius particular segment respectively, Sum i is the sum of the pixel
r, search circle center coordinates (u, v) that satisfy values Pijk of the segment i, SegAvgi is the average of pixel
the equation (x-u)2+(y-v)2=r2 and increase count in
values of segment i.
Hough M atrix at (u, v, r) by 1.
Step 3. Repeat step 2 for other radii.
14
International Journal of Computer Applications (0975 – 8887)
Volume 26– No.4, July 2011
(v) (vi)
(i) (ii) (iii) (iv)
(xiii) (xiv)
Fig. 2: Indian Coins of different Denominations; (i) Head of `1 coin (1st type), (ii) Tail of `1 coin (1st type), (iii) Head of `1 coin (2nd
type), (iv) Tail of `1 coin (2nd type), (v) Head of `2 coin (1st type), (vi) Tail of `2 coin (1st type), (vii) Head of `2 coin (2nd type), (viii)
Tail of `2 coin (2nd type), (ix) Head of `5 coin (1st type), (x) Tail of `5 coin (1st type), (xi) Head of `5 coin (2nd type), (xii) Tail of `5
coin (2nd type), (xiii) Head of `10 coin, (xiv) Tail of `10 coin
3.6 Generate Feature Vector and pass it as that to which denomination the given coin belongs i.e. if coin
gets classified in one of the class from (i) to (iv) then we say it is
Input to Trained NN
In this step, a feature vector is generated from the pattern a `1 coin. Similarly, for other classes we give ap propriate result.
averaged coin image. The 20×20 image generates a feature In Fig. 8 snapshot of the tool developed is given in which a `10
vector of dimension 400×1 i.e. all the pixel values are put into a coin is recognized.
vector of 1 column. Then, this feature vector of 400 features is
passed as input to trained neural network. Fig. 7 gives the 4. TRAINING AND TESTING DATA
architecture of Trained Neural Network. Five samples of each denomination of Indian coins are scanned
from both sides as shown in Fig. 2. So, it results to 10 images
for each coin. But for `1, `2 and `5 two types of coins are used.
So for each of these denominations there are 20 images from
which 10 (5 for head and 5 for tail) are of 1 st type and other 10
(5 for head and 5 for tail) are of 2 nd type. Then after
preprocessing when we get images of 100×100 then these
images were rotated to 50, 100, 150,….,3550 i.e. total 72 rotated
Fig. 7: Architecture of Trained Neural Network
images get generated for each image. So there are 20*72=1440
images for each of `1, `2 and `5 but 10*72=720 images for `10.
3.7 Give Appropriate Result according to the So there are total 1440*3+720=5040 images. So we trained the
neural network by randomly selecting images from these 5040
Output of Neural Network
Coins are classified into 14 categories as shown in Fig. 2. The images. 90% of 5040 images were used for training, and then
neural network classifies the given coin image into one of these 5% images were used for testing and rest 5% were used for
class and based on the classification the results get generated validation.
15
International Journal of Computer Applications (0975 – 8887)
Volume 26– No.4, July 2011
16
International Journal of Computer Applications (0975 – 8887)
Volume 26– No.4, July 2011
Table 1: Recognition Results 2.26% images get miss-recognized; the result is quite
encouraging.
S r. No. Coin Type Images Recognition
correctly Rate
recognized / 7. REFERENCES
(in %age) [1] Cai-ming Chen, Shi-qing Zhang, Yue-fen Chen, "A Coin
Total no. of
Recognition System with Rotation Invariance," 2010
images
International Conference on M achine Vision and Human-
1 `1 1412/1440 98.05 machine Interface, 2010, pp. 755-757.
2 `2 1426/1440 99.03
[2] Thumwarin, P., M alila, S., Janthawong, P. and Pibulwej,
3 `5 1368/1440 95 W., “A Robust Coin Recognition M ethod with Rotation
4 `10 720/720 100 Invariance”, 2006 International Conference on
Total 4926/5040 97.74 Communications, Circuits and Systems Proceedings, 2006,
pp. 520-523.
[3] Shen, L., Jia, S., Ji, Z. and Chen, W.S., “Statictics of
6. CONCLUSION Gabor features for coin recognition”, IEEE International
An ANN based automated coin recognition system has been Workshop on Imaging Systems and Techniques, 2009, pp.
developed using M ATLAB. In this system, firstly preprocessing 295 - 298.
of the images is done and then these preprocessed images are
[4] Gupta, V., Puri, R., Verma, M ., “Prompt Indian Coin
fed to the trained neural network. Neural network has been Recognition with Rotation Invariance using Image
trained, tested and validated using 5040 sample images of Subtraction Technique”, International Conference on
denominations `1, `2, `5 and `10 rotated at 50, 100, 150…., Devices and Communications (ICDeCom), 2011
3550. Experiments show that the system provides 97.74% [5] P. Davidsson, “Coin classification using a novel technique
correct recognition rate from 5040 sample images, i.e., only for learning characteristic decision trees by controlling the
degree of generalization”, Ninth International Conference
17
International Journal of Computer Applications (0975 – 8887)
Volume 26– No.4, July 2011
on Industrial & Engineering Applications of Artificial [8] Khashman A., Sekeroglu B. and Dimililer K., “Intelligent
Intelligence & Expert Systems, 1996. Coin Identification System”, Proceedings of the IEEE
[6] Fukumi M . and Omatu S., "Rotation-Invariant Neural International Symposium on Intelligent Control ( ISIC'06 ),
Pattem Recognition System with Application to Coin M unich, Germany, 4-6 October 2006, pp. 1226-1230.
Recognition", IEEE Trans. Neural Networks, Vol.3, No. 2, [9] Roushdy, M., “Detecting Coins with Different Radii based
pp. 272-279, M arch, 1992. on Hough Transform in Noisy and Deformed Image”, In
[7] Fukumi M . and Omatu S., "Designing A Neural Network the proceedings of GVIP Journal, Volume 7, Issue 1, April,
For Coin Recognition By A Genetic Algorithm", 2007.
Proceedings of 1993 International Joint Conference on
Neural Networks, Vol. 3, pp. 2109-2112, Oct, 1993.
18