The development of technology is becoming necessary in multiple fields that specialize in human interaction life. This has contributed to increasing awareness of electronic financial transactions by enhancing the ease of handling currencies, especially by employing vending machines in commercial markets and airports. Vending machines have become widespread nowadays, and due to their ease of use for customers, it has become necessary to pay attention to this type of device. Due to the different currencies adopted in countries around the world, there has emerged a need to increase the flexibility of programming these machines to be suitable for the countries using the devices. In this research, an intelligent convolutional neural network model CNN was built based on artificial intelligence techniques integrated with the Mahalanob distance method to embed the suggested “CNN-ThrMah” model. The dataset, which contains types of banknotes issued by the Central Bank of Iraq, was collected using digital scanning supplied by a high-resolution camera to achieve high accuracy. Then, the “CNN-ThrMah” model was built and trained on this data, using the optimizer “AdamW” to achieve a high level of accuracy in detecting the types of currencies for the tested data that the model had not seen. While a Mahalanobis-distance method is used to prevent the model from overfitting when generalizing in the real world. This model achieves high accuracy for all detections of all positive samples of Iraqi currencies and negative samples of non-currency items that contain currency from other countries