Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • Article
  • Published:

Efficient and adaptive sensory codes

Abstract

The ability to adapt to changes in stimulus statistics is a hallmark of sensory systems. Here, we developed a theoretical framework that can account for the dynamics of adaptation from an information processing perspective. We use this framework to optimize and analyze adaptive sensory codes, and we show that codes optimized for stationary environments can suffer from prolonged periods of poor performance when the environment changes. To mitigate the adversarial effects of these environmental changes, sensory systems must navigate tradeoffs between the ability to accurately encode incoming stimuli and the ability to rapidly detect and adapt to changes in the distribution of these stimuli. We derive families of codes that balance these objectives, and we demonstrate their close match to experimentally observed neural dynamics during mean and variance adaptation. Our results provide a unifying perspective on adaptation across a range of sensory systems, environments, and sensory tasks.

This is a preview of subscription content, access via your institution

Access options

Buy this article

Prices may be subject to local taxes which are calculated during checkout

Fig. 1: Adaptation can improve performance on sensory tasks.
Fig. 2: Adaptive sensory codes exhibit different patterns of error.
Fig. 3: Biased codes improve global performance.
Fig. 4: Biased codes improve performance across a range of stimulus conditions.
Fig. 5: Biased codes capture diverse profiles and timescales of adaptive dynamics.
Fig. 6: Feed-forward network can increase information transmission by biasing away from local stimulus statistics.

Similar content being viewed by others

Data availability

Data sharing is not applicable as no datasets were generated or analyzed in the current study.

Code availability

Code was written in MATLAB and is available at https://github.com/HermundstadLab/EfficientAdaptiveCodes.

References

  1. Adrian, E. D. & Zotterman, Y. The impulses produced by sensory nerve endings: part 3. Impulses set up by touch and pressure. J. Physiol. 61, 465–483 (1926).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  2. Kastner, D. B. & Baccus, S. A. Coordinated dynamic encoding in the retina using opposing forms of plasticity. Nat. Neurosci. 14, 1317 (2011).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  3. Ulanovsky, N., Las, L., Farkas, D. & Nelken, I. Multiple time scales of adaptation in auditory cortex neurons. J. Neurosci. 24, 10440–10453 (2004).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  4. Dean, I., Harper, N. S. & McAlpine, D. Neural population coding of sound level adapts to stimulus statistics. Nat. Neurosci. 8, 1684 (2005).

    Article  CAS  PubMed  Google Scholar 

  5. Ollerenshaw, D. R., Zheng, H. J. V., Millard, D. C., Wang, Q. & Stanley, G. B. The adaptive trade-off between detection and discrimination in cortical representations and behavior. Neuron 81, 1152–1164 (2014).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  6. Srinivas, G.-S., Mahmut, D., Junjianjia, L., A, C. D. & Thierry, E. Olfactory receptor neurons use gain control and complementary kinetics to encode intermittent odorant stimuli. eLife 6, e27670 (2017).

    Article  Google Scholar 

  7. Clarke, S. E., Longtin, A. & Maler, L. Contrast coding in the electrosensory system: parallels with visual computation. Nat. Rev. Neurosci.16, 733 (2015).

    Article  CAS  PubMed  Google Scholar 

  8. Fairhall, A. L., Lewen, G. D., Bialek, W. & de Ruyter van Steveninck, R. R. Efficiency and ambiguity in an adaptive neural code. Nature 412, 787 (2001).

    Article  CAS  PubMed  Google Scholar 

  9. Brenner, N., Bialek, W. & de Ruyter Van Steveninck, R. Adaptive rescaling maximizes information transmission. Neuron 26, 695–702 (2000).

    Article  CAS  PubMed  Google Scholar 

  10. Sharpee, T. O. et al. Adaptive filtering enhances information transmission in visual cortex. Nature 439, 936 (2006).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  11. Gutnisky, D. A. & Dragoi, V. Adaptive coding of visual information in neural populations. Nature 452, 220 (2008).

    Article  CAS  PubMed  Google Scholar 

  12. Laughlin, S. A simple coding procedure enhances a neuron’s information capacity. Z. Naturforsch. C Biosci. 36, 910–912 (1981).

    Article  CAS  PubMed  Google Scholar 

  13. Wang, Q., Webber, R. M. & Stanley, G. B. Thalamic synchrony and the adaptive gating of information flow to cortex. Nat. Neurosci. 13, 1534 (2010).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  14. Lesica, N. A. et al. Adaptation to stimulus contrast and correlations during natural visual stimulation. Neuron 55, 479–491 (2007).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  15. Rabinowitz, N. C., Willmore, B. D. B., Schnupp, J. W. H. & King, A. J. Contrast gain control in auditory cortex. Neuron 70, 1178–1191 (2011).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  16. Smirnakis, S. M., Berry, M. J., Warland, D. K., Bialek, W. & Meister, M. Adaptation of retinal processing to image contrast and spatial scale. Nature 386, 69 (1997).

    Article  CAS  PubMed  Google Scholar 

  17. Wark, B., Lundstrom, B. N. & Fairhall, A. Sensory adaptation. Curr. Opin. Neurobiol. 17, 423–429 (2007).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  18. Barlow, H. B. et al. Possible principles underlying the transformation of sensory messages. Sensory Communication 1, 217–234 (1961).

    Google Scholar 

  19. Palmer, S. E., Marre, O., Berry, M. J. & Bialek, W. Predictive information in a sensory population. Proc. Natl Acad. Sci. USA 112, 6908–6913 (2015).

  20. Wang, Z., Stocker, A. A. & Lee, D. D. Efficient neural codes that minimize Lp reconstruction error. Neural Comput. 28, 2656–2686 (2016).

    Article  PubMed  Google Scholar 

  21. DeWeese, M. & Zador, A. Asymmetric dynamics in optimal variance adaptation. Neural Comput. 10, 1179–1202 (1998).

    Article  Google Scholar 

  22. Weber, A. I., Krishnamurthy, K. & Fairhall, A. L. Coding principles in adaptation. Ann. Rev. Vis. Sci. 5, 427–449 (2019).

    Article  Google Scholar 

  23. Srinivasan, M. V., Laughlin, S. B. & Dubs, A. Predictive coding: a fresh view of inhibition in the retina. Proc. R. Soc. Lond. B Biol. Sci. 216, 427–459 (1982).

    Article  CAS  PubMed  Google Scholar 

  24. van Hateren, J. H. A theory of maximizing sensory information. Biol. Cybern. 68, 23–29 (1992).

    Article  PubMed  Google Scholar 

  25. Pillow, J. W. Spatio-temporal correlations and visual signalling in a complete neuronal population. Nature 454, 995–999 (2008).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  26. Brinkman, B. A. W., Weber, A. I., Rieke F. & Shea-Brown, E. How do efficient coding strategies depend on origins of noise in neural circuits? PLoS Comput. Biol. 12, e1005150 (2016).

  27. Pitkow, X. & Meister, M. Decorrelation and efficient coding by retinal ganglion cells. Nat. Neurosci. 15, 628 (2012).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  28. Olshausen, B. A. & Field, D. J. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature 381, 607 (1996).

    Article  CAS  PubMed  Google Scholar 

  29. Gjorgjieva, J., Sompolinsky, H. & Meister, M. Benefits of pathway splitting in sensory coding. J. Neurosci. 34, 12127–12144 (2014).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  30. Deneve, S. Bayesian spiking neurons I: inference. Neural Comput. 20, 91–117 (2008).

    Article  PubMed  Google Scholar 

  31. Nemenman, I. Information theory and adaptation. in Quantitative Biology: From Molecular to Cellular Systems (ed. Wall, M.) 73–92 (CRC Press, 2012).

  32. Wark, B., Fairhall, A. & Rieke, F. Timescales of inference in visual adaptation. Neuron 61, 750–761 (2009).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  33. Kastner, D. B. & Baccus, S. A. Spatial segregation of adaptation and predictive sensitization in retinal ganglion cells. Neuron 79, 541–554 (2013).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  34. Appleby, T. R. & Manookin, M. B. Neural sensitization improves encoding fidelity in the primate retina. Nat. Commun. 10, 1–15 (2019).

    Article  CAS  Google Scholar 

  35. Tikidji-Hamburyan, A. et al. Retinal output changes qualitatively with every change in ambient illuminance. Nat. Neurosci. 18, 66–74 (2015).

    Article  CAS  PubMed  Google Scholar 

  36. Lundstrom, B. N., Higgs, M. H., Spain, W. J. & Fairhall, A. L. Fractional differentiation by neocortical pyramidal neurons. Nat. Neurosci.11, 1335 (2008).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  37. Bell, A. J. & Sejnowski, T. J. The ‘independent components’ of natural scenes are edge filters. Vis. Res. 37, 3327–3338 (1997).

    Article  CAS  PubMed  Google Scholar 

  38. Karklin, Y. & Lewicki, M. S. Emergence of complex cell properties by learning to generalize in natural scenes. Nature 457, 83–86 (2009).

    Article  CAS  PubMed  Google Scholar 

  39. Tkačik, G., Prentice, J. S., Balasubramanian, V. & Schneidman, E. Optimal population coding by noisy spiking neurons. Proc. Natl Acad. Sci. USA 107, 14419–14424 (2010).

    Article  PubMed  PubMed Central  Google Scholar 

  40. Fournier, J., Monier, C., Pananceau, M. & Frégnac, Y. Adaptation of the simple or complex nature of V1 receptive fields to visual statistics. Nat. Neurosci. 14, 1053–1060 (2011).

    Article  CAS  PubMed  Google Scholar 

  41. Dragoi, V., Sharma, J. & Sur, M. Adaptation-induced plasticity of orientation tuning in adult visual cortex. Neuron 28, 287–298 (2000).

    Article  CAS  PubMed  Google Scholar 

  42. Yeh, T., Lee, B. B. & Kremers, J. The time course of adaptation in macaque retinal ganglion cells. Vis. Res. 36, 913–931 (1996).

    Article  CAS  PubMed  Google Scholar 

  43. Hosoya, T., Baccus, S. A. & Meister, M. Dynamic predictive coding by the retina. Nature 436, 71 (2005).

    Article  CAS  PubMed  Google Scholar 

  44. Drew, P. J. & Abbott, L. F. Models and properties of power-law adaptation in neural systems. J. Neurophysiol. 96, 826–833 (2006).

  45. Ozuysal, Y. & Baccus, S. A. Linking the computational structure of variance adaptation to biophysical mechanisms. Neuron 73, 1002–1015 (2012).

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  46. Cortes, J. M. et al. The effect of neural adaptation on population coding accuracy. J. Comput. Neurosci. 32, 387–402 (2012).

    Article  PubMed  Google Scholar 

  47. Seriès, P., Stocker, A. A. & Simoncelli, E. P. Is the homunculus ‘aware’ of sensory adaptation? Neural Comput. 21, 3271–3304 (2009).

    Article  PubMed  PubMed Central  Google Scholar 

  48. Doi, E. & Lewicki, M. S. A simple model of optimal population coding for sensory systems. PLoS Comput. Biol. 10, e1003761 (2014).

  49. Latimer, K. W. et al. Multiple timescales account for adaptive responses across sensory cortices. J. Neurosci. 39, 10019–10033 (2019).

    Article  PubMed  PubMed Central  Google Scholar 

  50. Młynarski, W. F. & Hermundstad, A. M. Adaptive coding for dynamic sensory inference. eLife 7, e32055 (2018).

    Article  PubMed  PubMed Central  Google Scholar 

  51. van Hateren, J. H. & Ruderman, D. L. Independent component analysis of natural image sequences yields spatio-temporal filters similar to simple cells in primary visual cortex. Proc. R. Soc. Lond. B Biol. Sci. 265, 2315–2320 (1998).

    Article  Google Scholar 

  52. Tkačik, G. et al. Natural images from the birthplace of the human eye. PLoS ONE 6, e20409 (2011).

    Article  PubMed  PubMed Central  Google Scholar 

  53. Sharpee, T. O. Computational identification of receptive fields. Ann. Rev. Neurosci. 36, 103–120 (2013).

    Article  CAS  PubMed  Google Scholar 

Download references

Acknowledgements

We thank D. Kastner and T. Münch for generously providing figures from their work. We also thank V. Jayaraman, M. Noorman, T. Ma, and K. Krishnamurthy for useful discussions and feedback on the manuscript. W.F.M. was funded by the European Union’s Horizon 2020 Research and Innovation Programme under Marie Skłodowska-Curie Grant Agreement No. 754411. A.M.H. was supported by the Howard Hughes Medical Institute.

Author information

Authors and Affiliations

Authors

Contributions

W.F.M. and A.M.H. conceived the study, developed the theoretical framework, conducted the mathematical analysis, performed the simulations, interpreted the results, and wrote the paper.

Corresponding authors

Correspondence to Wiktor F. Młynarski or Ann M. Hermundstad.

Ethics declarations

Competing interests

The authors declare no competing financial interests.

Additional information

Peer review informationNature Neuroscience thanks the anonymous reviewers for their contribution to the peer review of this work.

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Extended data

Extended Data Fig. 1 Smoothing does not alter results.

a-c, Same results as shown in Fig. 3d-f, here without smoothing. Optimal values of αNL (stars) were chosen prior to smoothing.

Extended Data Fig. 2 Optimal dynamics are robust to parameter variations.

a, b, Optimal nonlinearies (left; shown in Fig. 4d,e) closely resemble those derived by linearly-interpolating parameters between the naively-adaptive code and the fully-biased code (right). Shown here as a function of the system’s posterior belief P(high) = \({P}_{t}^{H}\), for variance adaptation (a) and mean adaptation (b). c, d, The dependence of the offset (upper row) and slope (lower row) of the optimal nonlinearities on the bias αI can be approximated by a line that interpolates between the naively-adaptive code (αI = 0) and the fully-based code (αI = 1). Shown here for variance adaptation (c) and mean adaptation (d), for several different values of the posterior belief P(high).

Extended Data Fig. 3 Abrupt changes in encoding parameters arise from bifurcations in error landscapes.

a,b, Encoding nonlinearies (left panels; shown in Fig. 4d,e) show abrupt changes for small variations in the system’s posterior belief P(high) = \({P}_{t}^{H}\). These changes arise from variations in the underlying error landscapes (right panels) in which a single minimum bifurcates into two minima or vice-versa (a, upper row; global minima marked by red x’s), or when one of multiple local minima becomes the global minimum (a, lower row; b, both rows). In the case of variance adaptation, the error landscape is symmetric to positive versus negative variations in the offset of the encoding nonlinearity (x0), and thus bifurcations in the error landscape lead to two symmetric solutions (a, upper row). In such scenarios, we chose the solution corresponding to the lower value of x0 (marked by circles), because it produces lower spike counts on average.

Extended Data Fig. 4 Balance of errors is robust to changes in volatility.

a, As volatility increases, the posterior is faster to update and the error faster to decay (shown for the naively-adaptive code in response to an increase in variance). b-d, Biased codes produce qualitatively consistent patterns of performance regardless of volatility (upper panels), but the relative impact of biasing the code increases as volatility increases (lower panels). Higher volatility leads to relatively longer periods of mismatch (b, upper), higher mismatched errors and lower matched errors (c, upper), and higher global errors (d, upper). The percent change in each of these errors (measured relative to the naively-adaptive code and scaled by the difference in error between the static and oracle codes) increases as volatility increases (lower row), and the global error is thus minimized for larger values of bias (c-d; circled markers in upper panels).

Extended Data Fig. 5 Entropy coding transforms response levels and reduces average firing rates.

a-c, Entropy coding reassigns response levels to spike counts based on the predicted probability that a response level will be used. a, The encoding nonlinearity partitions stimuli drawn from the actual stimulus distribution (black) or predicted stimulus distribution (red) into discrete response levels. This partitioning determines the predicted (b, left) and actual (c, left) probability with which response levels will be used. b, Entropy coding reassigns spike counts in order of decreasing predicted probability (left); response levels that have higher predicted probability (darker red) will be assigned fewer spikes (middle). This leads to a recoded histogram that is weighted toward lower spike counts (right). The reassignment could be approximated by a quadratic nonlinearity, or by a thresholding exponential nonlinearity. c, The recoding scheme, which is based on predicted probability (b), determines how stimuli sampled from the actual stimulus distribution will be transformed into spike counts. d, Before recoding (left), firings rates do not change in response to a change between low (L) and high (H) stimulus variance, regardless of the value of αI. After recoding (right), all codes show a transient response to both increases and decreases in variance, and time-averaged firing rates are lower (inset). e, Before recoding (left), firing rates increase following a change from low (L) to high (H) stimulus mean, and decrease following a change from high to low mean. After recoding (right), all codes show a symmetric response to increases and decreases in mean, and time-averaged firing rates are lower (inset).

Extended Data Fig. 6 Volatility shapes posterior dynamics.

a,c, As volatility increases (that is, as the switching period decreases), the posterior is faster to respond to both increases (upper) and decreases (lower) in stimulus variance (a) and mean (c). We estimated this timescale by linearly interpolating the posterior before computing the time at which it crosses 0.5. b, When stimulus variance is changing in time, the naively-adaptive code (αI = 0, upper left) is faster to respond to decreases in variance (solid lines) than to increases (dashed lines). In contrast, biased codes (upper middle, right) are faster to respond to increases in variance. This is largely driven by a more rapid response to increases in variance with increasing bias (lower left), but is also weakly affected by a slower response to decreases in variance (lower right). d, The posterior is equally fast to respond to increases and decreases in the stimulus mean (upper row), with a timescale that decreases as bias increases (lower row).

Supplementary information

Supplementary Information

Supplemental Note with mathematical analysis and Supplementary Fig. 1

Reporting Summary

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Młynarski, W.F., Hermundstad, A.M. Efficient and adaptive sensory codes. Nat Neurosci 24, 998–1009 (2021). https://doi.org/10.1038/s41593-021-00846-0

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1038/s41593-021-00846-0

This article is cited by

Search

Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing