Electroencephalogram (EEG) is a set of time series each of which can be represented as a 2D image (spectrogram), so that EEG recording can be mapped to the C-dimensional image (where C denotes the number of channels in the image and equals to the number of electrodes in EEG montage). In this paper, a novel approach for automated feature extraction from spectrogram representation is proposed. The method involves the usage of autoencoder models based on 3-dimensional convolution layers and 2-dimensional deformable convolution layers. Features, extracted by autoencoders, can be used to classify patients with Major Depressive Disorder (MDD) from healthy controls based on resting-state EEG. The proposed approach outperforms baseline ML models trained on spectral features extracted manually. The source code is available on: source code