Single-Trial Decoding from Local Field Potential Using Bag of Word Representation

  • Mohsen Parto Dezfouli
  • Mohammad Reza DaliriEmail author
Original Paper


Neural decoding allows us to study the brain functions by investigating the relationship between a stimulus and the corresponding response. Recently, the local field potential (LFP) has been targeted as a hallmark of brain activity for neural decoding. Despite several decoding methods, there is still a lack of a comprehensive framework to decode cognitive functions in an integrated structure. Here, we addressed this issue by developing a dictionary-based method to represent the LFP signals via a bag-of-words (BOW) approach. First, we defined a general dictionary consisting of various Gabor wavelets as the words which enabled us to represent LFPs in word domain. For each trial, the LFP signal was convolved with the dictionary words. The integral of the absolute value and the mean phase of the complex output were considered as histogram weights. In the next step, using cross-validation leave-one-out method, the trials were split into the training and test sets. The weights of each individual word were swapped across trials within a certain category of the training set while the sequential order was maintained. Finally, the test trial was classified using label voting in the k-nearest training trials. We conducted the proposed method on two independent LFP data sets, recorded from the rat primary auditory cortex (A1) and monkey middle temporal area in order to evaluate its efficiency. In addition to the chance level, the proposed method was compared with a standard BOW approach that has been extended recently for biomedical signals classification. Results show a high efficiency (~ 15% improvement in decoding accuracy) of the proposed method. Together, the aforementioned method provides a comprehensive framework for single-trial decoding from short-length electrophysiological signals.


Bag-of-words (BOW) Dictionary-based method Local field potential (LFP) Single-trial decoding 



This work was supported by the Iran National Science Foundation (INSF) (No. 95850065). We would like to thank Dr. Vladislav Kozyrev and Prof. Stefan Treue (German Primate Center, Cognitive Neuroscience Laboratory) for sharing the data recorded from the middle temporal area of two monkeys. We also thank Prof. Abbas Erfanian [Iran Neural Technology Center (INTC)] to support the experimental recording of the auditory data. We also thank Dr. Shima Talehy for her meticulous proof-reading of the manuscript and for her grammatical corrections.

Author Contributions

M.P.D. & M.R.D. designed the study. M.P.D. & M.R.D. collected the data. M.P.D. analyzed the data; M.P.D. & M.R.D. wrote the manuscript. M.R.D. supervised the study.

Conflict of interest

The authors declare no competing financial interests.

Ethical Approval

Research with animal subjects represents a small but indispensable component of neuroscience research. The scientists in this study are aware and are committed to the great responsibility they have in ensuring the best possible science with the least possible harm to the animals (Calapai et al. 2017). The main goal of the current study was to develop a comprehensive framework for the purpose of single-trial decoding from LFP signals.

Supplementary material

10548_2019_726_MOESM1_ESM.docx (664 kb)
Supplementary material 1 (DOCX 664 kb)


  1. Ahmadi M, Quiroga RQ (2013) Automatic denoising of single-trial evoked potentials. Neuroimage 66:672–680CrossRefGoogle Scholar
  2. Albright TD (1984) Direction and orientation selectivity of neurons in visual area MT of the macaque. J Neurophysiol 52:1106–1130CrossRefGoogle Scholar
  3. Aldavert D, Rusiñol M, Toledo R, Lladós J (2015) A study of bag-of-visual-words representations for handwritten keyword spotting. Int J Doc Anal Recognit 18:223–234CrossRefGoogle Scholar
  4. Arlot S, Celisse A (2010) A survey of cross-validation procedures for model selection. Stat Surv 4:40–79CrossRefGoogle Scholar
  5. Atienza M, Cantero J, Quiroga RQ (2005) Precise timing accounts for posttraining sleep-dependent enhancements of the auditory mismatch negativity. Neuroimage 26:628–634CrossRefGoogle Scholar
  6. Baydogan MG, Runger G, Tuv E (2013) A bag-of-features framework to classify time series. EEE Trans Pattern Anal Mach Intell 35:2796–2802CrossRefGoogle Scholar
  7. Belchior H, Lopes-dos-Santos V, Tort AB, Ribeiro S (2014) Increase in hippocampal theta oscillations during spatial decision making. Hippocampus 24:693–702CrossRefGoogle Scholar
  8. Bénar CG et al (2007) Single-trial analysis of oddball event-related potentials in simultaneous EEG-fMRI. Hum Brain Mapp 28:602–613CrossRefGoogle Scholar
  9. Calapai A, Berger M, Niessing M, Heisig K, Brockhausen R, Treue S (2017) A cage-based training, cognitive testing and enrichment system optimized for rhesus macaques in neuroscience research. Behav Res Methods 49:35–45CrossRefGoogle Scholar
  10. Candan KS, Rossini R, Wang X, Sapino ML (2012) sDTW computing DTW distances using locally relevant constraints based on salient feature alignments. Proc VLDB Endow 5:1519–1530CrossRefGoogle Scholar
  11. Chomboon K, Chujai P, Teerarassamee P, Kerdprasop K, Kerdprasop N (2015) An empirical study of distance metrics for k-nearest neighbor algorithm. In: Proceedings of the 3rd international conference on industrial application engineeringGoogle Scholar
  12. Cui Y, Liu LD, McFarland JM, Pack CC, Butts DA (2016) Inferring cortical variability from local field potentials. J Neurosci 36:4121–4135CrossRefGoogle Scholar
  13. Dezfouli MAP, Dezfouli MP, Rad HS (2014) A novel approach for baseline correction in 1 H-MRS signals based on ensemble empirical mode decomposition. In: 2014 36th annual international conference of the IEEE Engineering in Medicine and Biology Society (pp. 3196–3199). IEEE.
  14. Feng H, Golshan HM, Mahoor MH (2018) A wavelet-based approach to emotion classification using EDA signals. Expert Syst Appl 112:77–186CrossRefGoogle Scholar
  15. Friese U, Koster M, Hassler U, Martens U, Trujillo-Barreto N, Gruber T (2013) Successful memory encoding is associated with increased cross-frequency coupling between frontal theta and posterior gamma oscillations in human scalp-recorded EEG. Neuroimage 66:642–647CrossRefGoogle Scholar
  16. Gabor D (1946) Theory of communication: the analysis of information. J Inst Electr Eng 93:429–441Google Scholar
  17. Gail A, Brinksmeyer HJ, Eckhorn R (2004) Perception-related modulations of local field potential power and coherence in primary visual cortex of awake monkey during binocular rivalry. Cereb Cortex 14:300–313CrossRefGoogle Scholar
  18. Gao JF, Yang Y, Huang WT, Lin P, Ge S, Zheng HM, Gu LY, Zhou H, Li CH, Rao NN (2016) Exploring time-and frequency-dependent functional connectivity and brain networks during deception with single-trial event-related potentials. Sci Rep 6:37065CrossRefGoogle Scholar
  19. Hramov AE, Koronovskii AA, Makarov VA, Pavlov AN, Sitnikova E (2015) Wavelets in neuroscience. Springer, BerlinCrossRefGoogle Scholar
  20. Hu L, Xiao P, Zhang ZG, Mouraux A, Iannetti GD (2014) Single-trial time–frequency analysis of electrocortical signals: baseline correction and beyond. NeuroImage 84:876–887CrossRefGoogle Scholar
  21. Ince NF, Arica S, Tewfik A (2006) Classification of single trial motor imagery EEG recordings with subject adapted non-dyadic arbitrary time–frequency tilings. J Neural Eng 3:235CrossRefGoogle Scholar
  22. Ji W, Wang R, Ma J (2018) Dictionary-based active learning for sound event classification. Multimed Tools Appl 78(3):3831–3842CrossRefGoogle Scholar
  23. Johnson EL, King-Stephens D, Weber PB, Laxer KD, Lin JJ, Knight RT (2018a) Spectral imprints of working memory for everyday associations in the frontoparietal network. Front Syst Neurosci 12:65CrossRefGoogle Scholar
  24. Johnson EL, Adams JN, Solbakk AK, Endestad T, Larsson PG, Ivanovic J, Meling TR, Lin JJ, Knight RT (2018b) Dynamic frontotemporal systems process space and time in working memory. PLoS Biol 16:e2004274CrossRefGoogle Scholar
  25. Kao JC, Nuyujukian P, Ryu SI, Churchland MM, Cunningham JP, Shenoy KV (2015) Single-trial dynamics of motor cortex and their applications to brain-machine interfaces. Nat Commun 6:7759CrossRefGoogle Scholar
  26. Kayser SJ, Kayser C (2018) Trial by trial dependencies in multisensory perception and their correlates in dynamic brain activity. Sci Rep 8:3742CrossRefGoogle Scholar
  27. Kearns M, Ron D (1999) Algorithmic stability and sanity-check bounds for leave-one-out cross-validation. Neural Comput 11:1427–1453CrossRefGoogle Scholar
  28. King JR et al (2013) Single-trial decoding of auditory novelty responses facilitates the detection of residual consciousness. Neuroimage 83:726–738CrossRefGoogle Scholar
  29. Kreiman G, Hung C, Kraskov A, Quiroga RQ, Poggio T, DiCarlo J (2006) Object selectivity of local field potentials and spikes in the macaque inferior temporal cortex. Neuron 49:433–445CrossRefGoogle Scholar
  30. Lebanon G, Mao Y, Dillon J (2007) The locally weighted bag of words framework for document representation. J Mach Learn Res 8:2405–2441Google Scholar
  31. Leung T, Malik J (2001) Representing and recognizing the visual appearance of materials using three-dimensional textons. Int J Comput Vis 43:29–44CrossRefGoogle Scholar
  32. Li K, Kozyrev V, Kyllingsbæk S, Treue S, Ditlevsen S, Bundesen C (2016) Neurons in primate visual cortex alternate between responses to multiple stimuli in their receptive field. Front Comput Neurosci 10:141Google Scholar
  33. Lin J, Khade R, Li Y (2012) Rotation-invariant similarity in time series using bag-of-patterns representation. J Intell Inf Syst 39:287–315CrossRefGoogle Scholar
  34. Liu J, Newsome WT (2006) Local field potential in cortical area MT: stimulus tuning and behavioral correlations. J Neurosci 26:7779–7790CrossRefGoogle Scholar
  35. Logothetis NK (2003) The underpinnings of the BOLD functional magnetic resonance imaging signal. J Neurosci 23:3963–3971CrossRefGoogle Scholar
  36. Luo H, Poeppel D (2007) Phase patterns of neuronal responses reliably discriminate speech in human auditory cortex. Neuron 54:1001–1010CrossRefGoogle Scholar
  37. Lyon RF, Rehn M, Bengio S, Walters TC, Chechik G (2010) Sound retrieval and ranking using sparse auditory representations. Neural Comput. 22:2390–2416CrossRefGoogle Scholar
  38. Mehring C, Rickert J, Vaadia E et al (2003) Inference of hand movements from local field potentials in monkey motor cortex. Nat Neurosci 6:1253–1254CrossRefGoogle Scholar
  39. Mitzdorf U (1985) Current source-density method and application in cat cereb cortex: investigation of evoked potentials and EEG phenomena. Physiol Rev 65:37–99CrossRefGoogle Scholar
  40. Niebles JC, Wang H, Fei-Fei L (2008) Unsupervised learning of human action categories using spatial-temporal words. Int J Comput Vis 79:299–318CrossRefGoogle Scholar
  41. O’Leary JG, Hatsopoulos NG (2006) Early visuomotor representations revealed from evoked local field potentials in motor and premotor cortical areas. J Neurophysiol 96:1492–1506CrossRefGoogle Scholar
  42. Parto Dezfouli M, Daliri MR (2015) The effect of adaptation on the tuning curves of rat auditory cortex. PLoS ONE 10:e0115621CrossRefGoogle Scholar
  43. Parto Dezfouli MA, Parto Dezfouli M, Ahmadian A, Frangi AF, Esmaeili Rad M, Saligheh Rad H (2017) Quantification of 1H–MRS signals based on sparse metabolite profiles in the time–frequency domain. NMR Biomed 30:e3675CrossRefGoogle Scholar
  44. Pesaran B, Pezaris JS, Sahani M, Mitra PP, Andersen RA (2002) Temporal structure in neuronal activity during working memory in macaque parietal cortex. Nat Neurosci 5:805CrossRefGoogle Scholar
  45. Quiroga RQ, Garcia H (2003) Single-trial event-related potentials with wavelet denoising. Clin Neurophysiol 114:376–390CrossRefGoogle Scholar
  46. Rickert J, Oliveira SC, Vaadia E, Aertsen A, Rotter S et al (2005) Encoding of movement direction in different frequency ranges of motor cortical local field potentials. J Neurosci 25:8815–8824CrossRefGoogle Scholar
  47. Rubinstein R, Bruckstein AM, Elad M (2010) Dictionaries for sparse representation modeling. Proc IEEE 98:1045–1057CrossRefGoogle Scholar
  48. Silva FB, Werneck RDO, Goldenstein S, Tabbone S, Torres RDS (2018) Graph-based bag-of-words for classification. Pattern Recogn 74:266–285CrossRefGoogle Scholar
  49. Szymanski FD, Rabinowitz NC, Magri C, Panzeri S, Schnupp JW (2011) The laminar and temporal structure of stimulus information in the phase of field potentials of auditory cortex. J Neurosci 31:15787–15801CrossRefGoogle Scholar
  50. Taghizadeh-Sarabi M, Daliri MR, Niksirat KS (2015) Decoding objects of basic categories from electroencephalographic signals using wavelet transform and support vector machines. Brain Topogr 28:33–46CrossRefGoogle Scholar
  51. Tremblay S, Pieper F, Sachs A, Martinez-Trujillo J (2015a) Attentional filtering of visual information by neuronal ensembles in the primate lateral prefrontal cortex. Neuron 85:202–215CrossRefGoogle Scholar
  52. Tremblay S, Doucet G, Pieper F, Sachs A, Martinez-Trujillo J (2015b) Single-trial decoding of visual attention from local field potentials in the primate lateral prefrontal cortex is frequency-dependent. J Neurosci 35:9038–9049CrossRefGoogle Scholar
  53. Turnbull D, Barrington L, Torres D, Lanckriet G (2008) Semantic annotation and retrieval of music and sound effects. IEEE Trans Audio Speech Lang Process 16:467–476CrossRefGoogle Scholar
  54. Van Wingerden M, van der Meij R, Kalenscher T, Maris E, Pennartz CM (2014) Phase-amplitude coupling in rat orbitofrontal cortex discriminates between correct and incorrect decisions during associative learning. J Neurosci 34:493–505CrossRefGoogle Scholar
  55. Wang J, Liu P, She MF, Nahavandi S, Kouzani A (2013) Bag-of-words representation for biomedical time series classification. Biomed Signal Process Control 8:634–644CrossRefGoogle Scholar
  56. Xie J, Beigi MS (2009) A scale-invariant local descriptor for event recognition in 1d sensor signals. In: ICME, IEEE international conference, pp 1226–1229Google Scholar
  57. Zhao R, Mao K (2018) Fuzzy bag-of-words model for document representation. IEEE Trans Fuzzy Syst 26:794–804CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2019

Authors and Affiliations

  1. 1.Neuroscience & Neuroengineering Research Lab., Biomedical Engineering Department, School of Electrical EngineeringIran University of Science and Technology (IUST)NarmakIran

Personalised recommendations