Brain-Computer Interface (BCI) is a promising technology that enables people affected by neuromuscular disorders to control external devices like a wheelchair or prosthesis with the help of their brain signals. Functional near-infrared spectroscopy (fNIRS) is a non-invasive optical neuroimaging technique that describes the brain hemodynamics. Recently, it has been investigated for the development of BCI application. In the current study, fNIRS signals that report changes in hemoglobin concentrations acquired during imagination of executing four motor tasks namely, right-fist clenching, left-fist clenching, right- and left-foot tapping and rest have been explored. Besides employing conventional machine learning algorithms used in BCI field such as Support Vector Machine (SVM), Multilayer Perceptron (MLP) neural network, and Projection-based learning in a Meta-cognitive Radial Basis Function Network (PBL-McRBFN), a deep learning approach namely, Convolutional Neural Network (CNN) has been explored to classify the motor imagery fNIRS signals. Also, the selection of the best input image representation of the one-dimensional fNIRS signal to be used for CNN architecture is investigated. In comparison to conventional machine learning algorithms, the performance of CNN was superior with respect to the classification of four-class motor imagery fNIRS signals, with an average classification accuracy value of 72.35 ± 4.4%. The results show that the classification of fNIRS signals is possible using deep learning approach for the development of BCI application specifically using spectrogram representation of the fNIRS signal.