Ensemble Deep Learning for Brazil Currency Coin Prediction

In this present fast growing environment the automatic coin reorganization and identification machines has a vital role in all financial allied fields. At present most of coin recognition techniques are depends on physical properties of the coin like length, width, weight etc. Whereas image processing techniques are based on extraction of colour of the coin, edge features of the coin and shape of the coin. For recognition and detection of Brazil currency we have designed Machine Learning, Deep Learning (DL) models in this paper. We have designed various a Machine Learning (ML) models with Convolutional Neural Network for identification and reorganization of Brazil currency. Brazil currency consisting of 5 Centavos, 10 Centavos, 25 Centavos etc. Each of which has different shapes and designs. Different deep learning models are designed and applied ensemble to find the better accuracy. The trained ensemble model is tested on various the datasets which consists of shifting of images, rotation and translated images.


Introduction
In this present fast growing environment the automatic coin reorganization and identification machines has a vital role in all financial allied fields. Coin detection/prediction has various applications. These techniques may used in automated toll gates, slot machines, vending machine, coin based certificate printing devices etc. There are 3 different types of traditional coin prediction techniques which use Image Processing, Electromagnetic and Mechanical techniques [1]. In image processing technique the coins are predicted based on the pattern of the coin. The image based coin prediction technique involves basically two steps, the first step is taking the picture of the coin and the second step is to compare it with the reference coin database. The dataset contains images of various coins taken in various angles. After capturing the image of coin, some image processing techniques like Edge detection, DCT, Segmentation, FFT, Gabor Wavelets image subtraction, ANN, SIFT, decision trees, etc. are used to process the image. In the Electromagnetic approach, the material properties to manufacture the coin are considered. So if two coins are made up of the same material then these  [2] proposed Side and Rotation invariant coin recognition technique on Indian coins. In their work, the authors have identified the coin in the given image using segmentation. The coin prediction is performed using the radius of coins and based on template matching by the rotating the image. It is observed that the accuracy is ~90%.  [3] proposed ANN based automatic coin recognition on Indian coins. In their work, the authors have generated feature vector of image of size 20x20 after preprocessing and pattern averaging the given input image. They have used 70 images of coins and generate 5040 images by different rotations and reported the accuracy ~97%. Reisert et al [4] proposed a fast technique for coin recognition on CIS benchmark dataset. The authors have used inverse bilinear interpolation to address the small gradient changes in the input images. Further to improve the speed, FFT of feature function is precomputed. The accuracy they achieved is ~97%. Veena et al [5] used Spatial Gray Level Dependency Matrix and Steerable Pyramid and Laws Mask to extract the features of input images. To increase the performance here we have proposed a new technique. This is a Deep learning based mechanism which uses the Convolutional Neural Network technique. Nicola Capece et al [6] have implemented deep learning based coin recognition system for mobile devices. They have developed 5 different models for 5 different dataset of Euro coins. Some of the coins have reported the accuracy as 0% and some are reported as 100%. The authors have integrated the machine learning models with Android mobile App. Imanol Schlag et al [7] developed deep learning model for prediction of ancient roman coins. They have categorize the coins as Very Fine, Fine, Extreme Fine based on the condition of the coins.

Methodology
In this present fast growing environment the automatic coin reorganization and identification machines has a vital role in all financial allied fields. Coin recognition is a challenging task. Coin detection/prediction has various applications. These techniques may used in automated toll gates, slot machines, vending machine etc. There are 3 different ways of traditional coin recognition techniques which uses Image Processing, Electromagnetic and Mechanical techniques. In this work for recognition of Brazil coin, we are experimenting with Convolutional Neural Network, a deep learning model. For classification problems, feature extraction is the challenging task. In the advent of Machine Learning techniques we think coin recognition becomes easier, but feature extraction is a tough task. There are many ML Techniques for recognition of the coin; but how accurate our ML technique recognizing the coin depends on the features extracted with Machine Learning Model. Convolutional Neural Networks (CNN) figure 1 is used to recognize and predict the Brazil coins. Using the handicraft features like color, dimensions for recognition of coin has not given high accuracy. CNN is being used for many applications like Character Recognition [11], traffic signal identification, object prediction etc., Hence we planned to consider the CNN in which the model itself extracts the features and helps in better feature extraction. CNN has multiple pooling layers, convolution layers, fully connected layers, activation functions. In the convolution layer the invariant features will generated by using the filter or kernel applied to the local neighbours. Then the invariant features are passed on to the next layer. The pooling layer is used to reduce the dimension of next convolution layer such that the number of parameters can reduced. The CNN architecture is represented in Figure 2.

Pooling Layer
The importance of the pooling layer is to minimize the convolute image size to the next convolution layer also as to reduce the parameters to calculate in the training process. Pooling also helps in learning the transformations due to translation and rotation. Pooling layer has to include in between the two convolution layers. There are different ways of applying pooling like Max Pooling, Average Pooling as shown in fig 6 etc., The method for Max Pooling with size 2x2 is presented in the Figure 5. The filter chosen is 2x2, the output each 2x2 matrix of convoluted images is consider for applying pooling, it is maximum of each 2x2 matrix in the convoluted image. The input for pooling layer is output of convolution layer. In pooling layer if the Kernel size is NxN and input image size is MxM then the resultant output reduces by 1/N times.

Evaluation Criterion
The key goal of this paper is to recognize the Brazil coins through Deep learning Ensemble after classification scheme on the images acquired from multiparameters like, weight, size and adding multiple filters for each model and calculate the accuracy and loss of the model. A confusion matrix is a ML technique to calculate the performance of the classifier on set of test data where true values will be known as shown in fig 4. Let TP denote true positive, let FP denote false positive, let TN denote true negative, and let FN denote false negative.

Ensemble Learning
Ensemble Learning (EL) is a different Trending technique in Deep Learning (DL), which utilizes a group of Supervised and Unsupervised learning models to attain enhanced classification results than the fundamental learning algorithms alone. Ensemble Learning can be largely grouped into three types as follows: • Bootstrap aggregating, also called bagging in fig 6, and proposed by Breiman [9] is a machine learning ensemble meta-algorithm intended to get better the stability and accuracy of machine learning algorithms used in regression and statistical classification. It also decreases the variance and assist in avoiding of overfitting. The random forest [10] algorithm is an instance of bagging, which groups a set of random decision trees to obtain high accuracy. Boosting refers to a family of ensemble algorithms which transform a weak classifier to strong classifier. Boosting in fig: 7 is an ensemble method for improving the model predictions of any given learning algorithm. The idea of boosting is to train weak learners sequentially, each trying to correct its predecessor. The Adaboost still is the most broadly implementation of boosting.
• Bucket of models is an ensemble learning technique in which a selection algorithm of utilized to selects the best model in a group of various models. Mostly it approaches through cross-validation.
The architecture for ensemble model of deep learning is represented in Figure 5.

Conclusion
Convolutional Neural Networks (CNN) is used to recognize and predict the Brazil coins. Using the handicraft features like color, dimensions for recognition of coin has not given high accuracy. In our work we consider Brazil currency coins of 5 Centavos, 10 Centavos, 25 Centavos etc. Each of which has different shapes and designs. For recognition of Brazil coin, we employed Convolutional Neural Network, a deep learning model. We have designed four different CNN models by varying the filters, network dimensions. Different deep learning models are designed and applied ensemble learning to find the better accuracy. Ensemble Learning (EL) is a different Trending technique in Deep Learning (DL), which utilizes a group of Supervised and Unsupervised learning models to attain enhanced classification results. We got ~87.36% of accuracy which is more than the accuracy given by the models with handicrafts features.

Future Scope
We will have to analyze why and where the prediction is failing. To increase the accuracy, in future we will adopt the LSTM and capsule network to handle the orientation.