A method of classification of microelectrode recordings taken during a deep brain stimulation using deep residual neural network with attention comprising steps of receiving signals from microelectrodes placed in the STN region of a brain in an input block; converting signals from the time domain into spectrograms in a conversion block; providing spectrograms to a computer implemented a deep residual neural network with attention created with a method comprising steps collecting a data set of recordings taken during a deep brain stimulation; splitting recordings into overlapping time chunks, and converting time chunks into spectrograms; dividing data set into a training set, a validation set, and a test set putting each spectrogram into a deep neural network of ResNet architecture augmented with a self-attention layer added after each of ResNet layers, with a head layer comprising a single 2D convolutional layer followed by batch normalization and ReLU activation function wherein the network is trained to return zero for time chunks taken from recordings made outside of the STN region of a brain and to return one for time chunks taken form recordings made within the STN region of a brain, fine tuning the network with the validation set, cross checking the network with the test set receiving classification done by the deep residual neural network with attention in an output block; presenting the result of classification done by the deep residual neural network with attention in an output block. receiving signals from microelectrodes placed in the STN region of a brain in an input block; converting signals from the time domain into spectrograms in a conversion block; providing spectrograms to a computer implemented a deep residual neural network with attention created with a method comprising steps collecting a data set of recordings taken during a deep brain stimulation; splitting recordings into overlapping time chunks, and converting time chunks into spectrograms; dividing data set into a training set, a validation set, and a test set putting each spectrogram into a deep neural network of ResNet architecture augmented with a self-attention layer added after each of ResNet layers, with a head layer comprising a single 2D convolutional layer followed by batch normalization and ReLU activation function wherein the network is trained to return zero for time chunks taken from recordings made outside of the STN region of a brain and to return one for time chunks taken form recordings made within the STN region of a brain, fine tuning the network with the validation set, cross checking the network with the test set collecting a data set of recordings taken during a deep brain stimulation; splitting recordings into overlapping time chunks, and converting time chunks into spectrograms; dividing data set into a training set, a validation set, and a test set putting each spectrogram into a deep neural network of ResNet architecture augmented with a self-attention layer added after each of ResNet layers, with a head layer comprising a single 2D convolutional layer followed by batch normalization and ReLU activation function wherein the network is trained to return zero for time chunks taken from recordings made outside of the STN region of a brain and to return one for time chunks taken form recordings made within the STN region of a brain, fine tuning the network with the validation set, cross checking the network with the test set receiving classification done by the deep residual neural network with attention in an output block; presenting the result of classification done by the deep residual neural network with attention in an output block.