Sparse representations

Laurent Perrinet

NeuroSchool PhD Program in Neuroscience

[2024-04-17]

logo
Code / Contact me @ laurent.perrinet@univ-amu.fr

Sparse representations?

Sparse representations in computer vision

[[LP *et al*, 2004](https://laurentperrinet.github.io/publication/perrinet-04-tauc/)]
[LP et al, 2004]

Sparse representations in computer vision

Sparse representations in computer vision

[[LP and Bednar, 2015]](https://laurentperrinet.github.io/publication/perrinet-bednar-15/)
[LP and Bednar, 2015]

Sparse representations in computer vision

[[LP, 2021](https://laurentperrinet.github.io/sciblog/posts/2021-03-27-density-of-stars-on-the-surface-of-the-sky.html)]
[LP, 2021]

Sparse representations in neuromorphic engineering

Sparse representations in neuromorphic engineering

The HD-SNN neural network.
The HD-SNN neural network.

Sparse representations in neuromorphic engineering

The HD-SNN neural network.
The HD-SNN neural network.

Sparse representations in neuroscience

[[Brunel, 2001](https://books.google.fr/books?hl=fr&lr=&id=b8woDqWdTssC&oi=fnd&pg=PA307&ots=KNHQrJ-TsZ&sig=0WI2cq2RnMXC7fVTyjOEWZEdlCg&redir_esc=y#v=onepage&q&f=false)]
[Brunel, 2001]

Sparse representations in neuroscience

[[Mainen & Sejnowski, 1995](https://github.com/SpikeAI/2022_polychronies-review/blob/main/src/Figure_2_MainenSejnowski1995.ipynb)]
[Mainen & Sejnowski, 1995]

Sparse representations in neuroscience

[[Kremkow *et al*, 2016](https://laurentperrinet.github.io/publication/kremkow-16/)]
[Kremkow et al, 2016]

Sparse representations in neuroscience

[[Kremkow *et al*, 2016](https://laurentperrinet.github.io/publication/kremkow-16/)]
[Kremkow et al, 2016]

Sparse representations in neuroscience

[[Kremkow *et al*, 2016](https://laurentperrinet.github.io/publication/kremkow-16/)]
[Kremkow et al, 2016]

Sparse representations?

Sparse representations in a nutshell

Sparse representations in a nutshell

[[LP *et al*, 2004](https://laurentperrinet.github.io/publication/perrinet-04-tauc/)]
[LP et al, 2004]

Sparse representations in a nutshell

[[Olshausen and Field (1997)](http://mplab.ucsd.edu/~marni/Igert/Olshaussen_1997.pdf)]
[Olshausen and Field (1997)]

Sparse representations in a nutshell

Generative model of image synthesis:

$I[x, y] = $ $\sum_{i=1}^{K} a[i] \cdot \phi[i, x, y]$ $ + \varepsilon[x, y]$

Where $\phi$ is a dictionary of $K$ atoms, $a$ is a sparse vector of coefficients, and $\varepsilon$ is a noise term.

[LP (2015)]

Sparse representations in a nutshell

[[Olshausen and Field (1997)](http://mplab.ucsd.edu/~marni/Igert/Olshaussen_1997.pdf)]
[Olshausen and Field (1997)]

Sparse representations in a nutshell

Given an observation $I$,

$$ \begin{aligned} \mathcal{L}(a) & = - \log Pr( a | I ) \\ \end{aligned} $$

Sparse representations in a nutshell

Given an observation $I$,

$$ \begin{aligned} \mathcal{L}(a) & = - \log Pr( a | I ) \\ & = - \log Pr( I | a ) - \log Pr(a) \\ \end{aligned} $$

Sparse representations in a nutshell

Given an observation $I$,

$$ \begin{aligned} \mathcal{L}(a) & = - \log Pr( a | I ) \\ & = - \log Pr( I | a ) - \log Pr(a) \\ & = \frac{1}{2\sigma_n^2} \sum_{x, y} ( I[x, y] - \sum_{i=1}^{K} a[i] \cdot \phi[i, x, y])^2 - \sum_{i=1}^{K} \log Pr( a[i] ) \end{aligned} $$

Sparse representations in a nutshell

The problem is formalized as an optimization problem $a^\ast = \arg \min_a \mathcal{L}(a)$ with:

$$ \mathcal{L} = \frac{1}{2} \sum_{x, y} ( I[x, y] - \sum_{i=1}^{K} a[i] \cdot \phi[i, x, y])^2 + \lambda \cdot \sum_i ( a[i] \neq 0) $$

[LP (2015)]

Sparse representations in a nutshell

The problem is formalized as an optimization problem $a^\ast = \arg \min_a \mathcal{L}(a)$ with:

$$ \mathcal{L}(a) = \frac{1}{2} \sum_{x, y} ( I[x, y] - \sum_{i=1}^{K} a[i] \cdot \phi[i, x, y])^2 + \lambda \cdot \sum_{i=1}^{K} | a[i] | $$

Sparse representations in a nutshell

[[Rentzeperis *et al* (2023)](https://laurentperrinet.github.io/publication/rentzeperis-23/)]
[Rentzeperis et al (2023)]

Sparse representations in a nutshell

[[Olshausen and Field (1997)](http://mplab.ucsd.edu/~marni/Igert/Olshaussen_1997.pdf)]
[Olshausen and Field (1997)]

Matching pursuit algorithm

  • Init : Residual $R = I$, sparse vector $a$ such that $\forall i$, $a[i] = 0$

  • while $\frac{1}{2} \sum_{x, y} R[x, y]^2 > \vartheta $, do :

Matching pursuit algorithm

  • Init : $R = I$, $\forall i$, $a[i] = 0$

  • while $\frac{1}{2} \sum_{x, y} R[x, y]^2 > \vartheta $, do :

    • compute $c[i] = \sum_{x, y} (R[x, y] - a[i] \cdot \phi[i, x, y])^2$
    • Match: $i^\ast = \arg \min_i c[i]$

Matching pursuit algorithm

  • Init : $R = I$, $\forall i$, $a[i] = 0$

  • while $\frac{1}{2} \sum_{x, y} R[x, y]^2 > \vartheta $, do :

    • Match : $i^\ast = \arg \max_i \sum_{x, y} R[x, y] \cdot \phi[i, x, y]$

Matching pursuit algorithm

  • Init : $R = I$, $\forall i$, $a[i] = 0$

  • while $\frac{1}{2} \sum_{x, y} R[x, y]^2 > \vartheta $, do :

    • Match : $i^\ast = \arg \max_i \sum_{x, y} ( I[x, y] \cdot \phi[i, x, y])$
    • Assign : $a[i^\ast] = \frac{\sum_{x, y} R[x, y] \cdot \phi[i^\ast, x, y]}{\sum_{x, y} \phi[i^\ast, x, y] \cdot \phi[i^\ast, x, y]}$

Matching pursuit algorithm

  • Init : $R = I$, $\forall i$, $a[i] = 0$, and normalize $\sum_{x, y} \phi[i, x, y]^2 = 1$

  • while $\frac{1}{2} \sum_{x, y} R[x, y]^2 > \vartheta $, do :

    • Match : $i^\ast = \arg \max_i \sum_{x, y} R[x, y] \cdot \phi[i, x, y]$
    • Assign : $a[i^\ast] = \sum_{x, y} R[x, y] \cdot \phi[i^\ast, x, y]$

Matching pursuit algorithm

  • Init : $R = I$, $\forall i$, $a[i] = 0$, $\sum_{x, y} \phi[i, x, y]^2 = 1$

  • while $\frac{1}{2} \sum_{x, y} R[x, y]^2 > \vartheta $, do :

    • Match : $i^\ast = \arg \max_i \sum_{x, y} R[x, y] \cdot \phi[i, x, y]$
    • Assign : $a[i^\ast] = \sum_{x, y} R[x, y] \cdot \phi[i^\ast, x, y]$
    • Pursuit : $R[x, y] \leftarrow R[x, y] - a[i^\ast] \cdot \phi[i^\ast, x, y]$

Matching pursuit algorithm

  • Init : $R = I$, $\forall i$, $a[i] = 0$, $\sum_{x, y} \phi[i, x, y]^2 = 1$

  • compute $c[i] = \sum_{x, y} R[x, y] \cdot \phi[i, x, y]$

  • compute $X[i, j] = \sum_{x, y} \phi[i, x, y] \cdot \phi[j, x, y]$

  • while $\frac{1}{2} \sum_{x, y} R[x, y]^2 > \vartheta $, do :

    • Match : $i^\ast = \arg \max_i c[i]$
    • Assign : $a[i^\ast] = c[i^\ast]$
    • Pursuit : $c[i] \leftarrow c[i] - a[i^\ast] \cdot X[i, i^\ast] $

[LP (2004)]

Matching pursuit algorithm

Code @ A hitchhiker guide to Matching Pursuit

Matching pursuit algorithm

Hebbian learning (once the sparse code is known):

$$ \phi_{i}[x, y] \leftarrow \phi_{i}[x, y] + \eta \cdot a[i] \cdot (I[x, y] - \sum_{i=1}^{K} a[i] \cdot \phi_{i}[x, y] ) $$

[LP (2015)]

Matching pursuit algorithm

Sparse representations in a nutshell

[[LP *et al*, 2004](https://laurentperrinet.github.io/publication/perrinet-04-tauc/)]
[LP et al, 2004]

Convolutional Sparse Coding

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

Convolutional Neural Nets (CNN)

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

Convolutional Neural Nets (CNN)

[[Jérémie & LP, 2023](https://laurentperrinet.github.io/publication/jeremie-23-ultra-fast-cat/)]
[Jérémie & LP, 2023]

Convolution: Mathematics

  • One-dimensional discrete convolution (eg in time) with a kernel $g$ of radius $K$: $$ (f \ast g)[n]=\sum_{m=-K}^{K} f[n-m] \cdot g[m] $$

Convolution: Mathematics

  • Convolution of an image (two-dimensional) with a kernel $g$ of radius $K\times K$:

$$ (f \ast g)[x, y] = \sum_{i=-K}^{K} \sum_{j=-K}^{K} f[x-i, y-j] \cdot g[i, j] $$

Convolution: Mathematics

  • Cross-correlation of an image (two-dimensional) with a kernel $g$ of radius $K\times K$:

$$ (f \ast \tilde{g})[x, y] = \sum_{i=-K}^{K} \sum_{j=-K}^{K} f[x+i, y+j] \cdot g[i, j] $$

Convolution: Mathematics

[[Amidi & Amidi](https://stanford.edu/~shervine/teaching/cs-230/cheatsheet-convolutional-neural-networks)]
[Amidi & Amidi]

Convolution: Mathematics

$$ (f \ast \tilde{g})[x, y] = \sum_{c=1}^{C} \sum_{c,i,j} f[c, x+i, y+j] \cdot g[c, i, j] $$

Convolution: Mathematics

$$ (f \ast \tilde{g})[k, x, y] = \sum_{c,i,j} f[c, x+i, y+j] \cdot g[k, c, i, j] $$

CNN: the HMAX model

[[Serre and Poggio, 2006]](https://biology.stackexchange.com/questions/10955/ventral-stream-pathway-and-architecture-proposed-by-poggios-group)
[Serre and Poggio, 2006]

CNN: challenges

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

Convolutional Sparse Coding

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

Convolutional Sparse Coding

Code @ A hitchhiker guide to Matching Pursuit

Convolutional Sparse Coding

[[LP, 2015](https://laurentperrinet.github.io/publication/perrinet-15-bicv/)]
[LP, 2015]

Code @ SparseEdges

Convolutional Sparse Coding

[[Ladret *et al*, 2024](https://laurentperrinet.github.io/publication/ladret-24-sparse/)]
[Ladret et al, 2024]

Convolutional Sparse Coding

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

Convolutional Sparse Coding

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

CNN: Predictive processing

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

CNN: Predictive processing

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

CNN: Predictive processing

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

CNN: Predictive processing

[[Boutin *et al*, 2021](https://laurentperrinet.github.io/publication/boutin-franciosini-chavane-ruffier-perrinet-20/)]
[Boutin et al, 2021]

CNN: Predictive processing

CNN: Topography

[Bosking *et al*, 1997]
[Bosking et al, 1997]

CNN: Topography

[[Boutin *et al*, 2022](https://laurentperrinet.github.io/publication/franciosini-21/)]
[Boutin et al, 2022]

Sparse representations

Laurent Perrinet

NeuroSchool PhD Program in Neuroscience

[2024-04-17]

logo
Code / Contact me @ laurent.perrinet@univ-amu.fr