# Fake Banknote Recognition Using Deep Learning
## 5 Custom Model
### Feature Maps  
Figure 12 shows some feature maps of the custom model at different depth levels. Two examples of original and their counterfeit banknotes are presented (i.e., 2k with 2 kf, and 5k with 5 kf), with a clear differences in their feature maps. For counterfeit banknotes, a large part of the feature maps are activated, while in the case of original banknotes, only a small part related to the UV security mask is activated. This shows that the custom model trained with the proposed data set is able to learn the weights of its filters in order to identify original and counterfeit banknotes.  
\begin{table}
\begin{tabular}{c c c c c c} \hline
**Layer** & **No. of Filters** & **K** & **S** & **P** & **Output Shape** & **Trainable Parameters** \\ \hline Input & - & - & - & - & (224, 224, 3) & 0 \\ Conv-1 & 64 & 11 & 4 & 2 & (55, 55, 64) & 23,296 \\ ReLu & - & - & - & - & (55, 55, 64) & 0 \\ MaxPooling-1 & 64 & 3 & 2 & 0 & (27, 27, 64) & 0 \\ Conv-2 & 192 & 5 & 1 & same & (27, 27, 192) & 307,392 \\ ReLu & - & - & - & - & (27, 27, 192) & 0 \\ MaxPooling-2 & 192 & 3 & 2 & 0 & (13, 13, 192) & 0 \\ Conv-3 & 384 & 3 & 1 & same & (13, 13, 384) & 663,936 \\ ReLu & - & - & - & - & (13, 13, 384) & 0 \\ Conv-4 & 256 & 3 & 1 & same & (13, 13, 256) & 884,992 \\ ReLu & - & - & - & - & (13, 13, 256) & 0 \\ Conv-5 & 256 & 3 & 1 & same & (13, 13, 256) & 590,080 \\ ReLu & - & - & - & - & (13, 13, 256) & 0 \\ MaxPooling-3 & 256 & 3 & 2 & 0 & (6, 6, 256) & 0 \\ Adaptive Pooling 6 \(\times\) 6 & - & - & - & - & (6, 6, 256) & 0 \\ Flattening & - & - & - & - & (9216, 1) & 0 \\ Dropout 0.5 & - & - & - & - & (9216, 1) & 0 \\ FC-1 & 512 & - & - & - & (512, 1) & 4,719,104 \\ Dropout 0.5 & - & - & - & - & (512, 1) & 0 \\ FC-2 & 512 & - & - & - & (512, 1) & 262,656 \\ FC-3 & 13 & - & - & - & (13, 1) & 6669 \\ \hline \end{tabular}
\end{table}
Table 1: Summary of the proposed network (K: Kernel, S: Stride, P: Padding).  
Figure 11: Comparison between training the custom model with randomized weight initialization or Xavier method.  
Additionally, the filters are able to learn to differentiate the denominations of the banknotes. Figure 13 shows an example for the different denominations in the dataset, only for original banknotes. It should be noted that the feature maps of the 20k banknote on channel0 and channel125 are different in relation to other banknotes, just as the feature maps of the 50k and 100k banknotes of the channel99 differ from the other denominations. In the case of channel191, the feature map is activated not only in the UV mark, but in the background.  
Figure 12: Example of feature maps for some banknotes (original and fake).  
This shows that the network is capable of extracting patterns that allow it not only to identify whether a banknote is original or counterfeit, but also its denomination. Training the network with the dataset allows the model to adjust the weights of its filters (parameters)  
Figure 13: Examples of feature maps for original banknotes.  
for the specific classification task. So, if you want to use the proposed network in another task, you will have to retrain the architecture with the corresponding dataset.