From recent studies, it is observed that convolutional neural networks are proved to be extremely successful in classification problems. Accurate and fast classification of electrocardiogram (ECG) beats is a crucial step in the implementation of real-time arrhythmia diagnosis systems. In this study, convolutional neural networks are employed to classify eleven different ECG beat types in the MIT-BIH arrhythmia database. We aimed to implement a computer-aided mobile diagnosis system equipped with artificial intelligence that detects the classes of heartbeats by visual inspection of the ECG records in the manner as the cardiologists do. Since doctors make their decisions basing heavily on the 2D visual appearances of the ECG signals without doing numerical calculations on 1D time samples, 2D images of 1D ECG records were given to the classifier as the input data. It would not be surprising that the structure of the network classifying 2D ECG data has to be larger than the one used to classify 1D ECG signals. The small size of a neural network is an important property for real-time use of the system. In this study, smaller network structures that provide high performances using the Walsh functions (WF), and drawbacks of converting 1D signals to 2D images have been investigated. The network structures using the WF during the training stage have been applied to different databases and successful results have been obtained. Classification results and sizes of the network structures are compared for the ECG beats in one dimension and in the form of 2D visuals. The training of ECG signals in the form of 2D visuals takes much longer time than that of the 1D signals. However, it is observed that training and testing times of both networks were quite fast. Moreover, average success rates of 99% were achieved for all beat types by using small-size networks.