Hierarchical Temporal Memory - Slovensk technick univerzita v

53
Hierarchical Temporal Memory Bio-inspired model of neocortex Kristi´ an Valent´ ın FMFI UK, ´ UM SAV [email protected] June 13, 2012

Transcript of Hierarchical Temporal Memory - Slovensk technick univerzita v

Hierarchical Temporal MemoryBio-inspired model of neocortex

Kristian Valentın

FMFI UK, UM SAV

[email protected]

June 13, 2012

IntroductionNeocortex

Hierarchical Temporal Memory

Overview

1 IntroductionMotivationResearch GoalsTask of Visual Object Recognition

2 NeocortexCommon Cortical AlgorithmNeocortex

3 Hierarchical Temporal MemoryHistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Outline

1 IntroductionMotivationResearch GoalsTask of Visual Object Recognition

2 NeocortexCommon Cortical AlgorithmNeocortex

3 Hierarchical Temporal MemoryHistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Motivation

Interesting field of AI

Many possible applications

Finding out something about us

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Motivation

Interesting field of AI

Many possible applications

Finding out something about us

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Motivation

Interesting field of AI

Many possible applications

Finding out something about us

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Research Goals

Long-term goals

Build an object recognition system which enables to classify visualobjects in complex scenes

Short-term goal

Hierarchical Temporal Memory (HTM)

Current goal

Improve spatial and temporal learning methods (invariancy, speed ofconvergence)

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Research Goals

Long-term goals

Build an object recognition system which enables to classify visualobjects in complex scenes

Short-term goal

Hierarchical Temporal Memory (HTM)

Current goal

Improve spatial and temporal learning methods (invariancy, speed ofconvergence)

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Research Goals

Long-term goals

Build an object recognition system which enables to classify visualobjects in complex scenes

Short-term goal

Hierarchical Temporal Memory (HTM)

Current goal

Improve spatial and temporal learning methods (invariancy, speed ofconvergence)

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Task of Visual Object Recognition

Classification of an object in a visual scene

Invariant classification

scalepositionrotation

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Task of Visual Object RecognitionExample

Figure: (George, 2007)

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Similarity Measure: Euclidean distance

Figure: (George, 2007)

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

MotivationResearch GoalsTask of Visual Object Recognition

Spatio-temporal Representation

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

Outline

1 IntroductionMotivationResearch GoalsTask of Visual Object Recognition

2 NeocortexCommon Cortical AlgorithmNeocortex

3 Hierarchical Temporal MemoryHistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

Common Cortical AlgorithmSupporting evidence

“Seeing in the Sound Zone,“ by Michael Merzenich, Nature, Vol.404, April 20, 2000, pp. 820-821.

”Induction of visual orientation modules in auditory cortex,“ byJitendra Sharma, Alessandra Angelucci and Mriganka Sur, Nature,Vol. 404, April 20, 2000, pp. 841-847

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

Sensory Substitution

A sensorimotor account of vision and visual consciousness, KevinO’Regan and Alva Noe, 2001.Photograph courtesy: P. Bach-y-Rita

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

Assumptions

Neocortex uses the same algorithm to learn different modalities

It learns efficiently

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

No Free Lunch Theorem

No learning algorithm has an inherent superiority over otherlearning algorithms for all problems. (Wolpert, 1995)

An algorithm’s superiority comes from the assumptions that it makesabout the problem

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

No Free Lunch Theorem

No learning algorithm has an inherent superiority over otherlearning algorithms for all problems. (Wolpert, 1995)

An algorithm’s superiority comes from the assumptions that it makesabout the problem

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

Assumptions

Neocortex uses the same algorithm to learn different modalities

It learns efficiently

=>Data from different modalities must have the same underlyingstatistical structure

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

Assumptions

Neocortex uses the same algorithm to learn different modalities

It learns efficiently

=>Data from different modalities must have the same underlyingstatistical structure

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

High-level properties of the neocortex

Hierarchical organization (spatial and temporal)

Using time as a supervisor

Ability to make predictions

Sparse Distributed Representations

Feed-forward and feedback connections

Sensory-motor

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

Why unsupervised pre-training makes sense

If image-label pairs were generatedthis way, it would make sense to trygo straight from images to labels

If image-label pairs were generatedthis way, it makes sense to first learnrecover the stuff that caused theimage by inverting the highbandwidth highway.

Credit: G. Hinton

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

Common Cortical AlgorithmNeocortex

Causes of the World

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Outline

1 IntroductionMotivationResearch GoalsTask of Visual Object Recognition

2 NeocortexCommon Cortical AlgorithmNeocortex

3 Hierarchical Temporal MemoryHistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

History

1 Memory-Prediction Framework

proposed that the neocortex uses hierarchical sequence memory forstoring and inferring causes in the worldproposed several learning algorithms including a detailed mappingonto the large scale cortical-thalamic architecture, as well as ontothe microcircuits of cortical columns

2 Hierarchical Temporal Memory (HTM)

proper mathematical foundation for M-P frameworkmapping the mathematics of HTM directly to cortical-thalamicanatomy and the microcircuits of cortical columns

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

History

1 Memory-Prediction Framework

proposed that the neocortex uses hierarchical sequence memory forstoring and inferring causes in the worldproposed several learning algorithms including a detailed mappingonto the large scale cortical-thalamic architecture, as well as ontothe microcircuits of cortical columns

2 Hierarchical Temporal Memory (HTM)

proper mathematical foundation for M-P frameworkmapping the mathematics of HTM directly to cortical-thalamicanatomy and the microcircuits of cortical columns

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Memory-Prediction Theory of Brain Function

Founded in On Intelligence (Hawkins Blakeslee, 2004)

Basic idea

The brain is a mechanism predicting the future and hierarchical regions ofthe brain predict their future input sequences.

Motivated by the observed fact that the mammalian neocortex isremarkably uniform in appearance and structure

Principally, the same hierarchical structures are used for a widerange of behaviors (+plasticity)

Assumptions

patterns from different senses are equivalent inside the brainthe same biological structures are used to process the sensory inputsa single principle (a feedback/recall loop) underlies processing of thepatterns

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Memory-Prediction Theory of Brain Function

Founded in On Intelligence (Hawkins Blakeslee, 2004)

Basic idea

The brain is a mechanism predicting the future and hierarchical regions ofthe brain predict their future input sequences.

Motivated by the observed fact that the mammalian neocortex isremarkably uniform in appearance and structure

Principally, the same hierarchical structures are used for a widerange of behaviors (+plasticity)

Assumptions

patterns from different senses are equivalent inside the brainthe same biological structures are used to process the sensory inputsa single principle (a feedback/recall loop) underlies processing of thepatterns

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Memory-Prediction Theory of Brain Function

Founded in On Intelligence (Hawkins Blakeslee, 2004)

Basic idea

The brain is a mechanism predicting the future and hierarchical regions ofthe brain predict their future input sequences.

Motivated by the observed fact that the mammalian neocortex isremarkably uniform in appearance and structure

Principally, the same hierarchical structures are used for a widerange of behaviors (+plasticity)

Assumptions

patterns from different senses are equivalent inside the brainthe same biological structures are used to process the sensory inputsa single principle (a feedback/recall loop) underlies processing of thepatterns

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Hierarchical Temporal Memory

Large-scale hierarchical model of the neocortex by Hawkins andGeorge, Numenta Inc. (2004, 2008)

Common cortical algorithm for all nodes

Learn common spatial patternsLearn common sequences of those patterns

Goal: Create a hierarchical, spatio-temporal model of data

Time is the teacher

Inference (recognition)

Bayesian belief propagationProbability of sequences passed upPredicted spatial patterns passed down

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Hierarchical Temporal Memory

Large-scale hierarchical model of the neocortex by Hawkins andGeorge, Numenta Inc. (2004, 2008)

Common cortical algorithm for all nodes

Learn common spatial patternsLearn common sequences of those patterns

Goal: Create a hierarchical, spatio-temporal model of data

Time is the teacher

Inference (recognition)

Bayesian belief propagationProbability of sequences passed upPredicted spatial patterns passed down

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Hierarchical Temporal Memory

Large-scale hierarchical model of the neocortex by Hawkins andGeorge, Numenta Inc. (2004, 2008)

Common cortical algorithm for all nodes

Learn common spatial patternsLearn common sequences of those patterns

Goal: Create a hierarchical, spatio-temporal model of data

Time is the teacher

Inference (recognition)

Bayesian belief propagationProbability of sequences passed upPredicted spatial patterns passed down

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Hierarchical Temporal Memory

Large-scale hierarchical model of the neocortex by Hawkins andGeorge, Numenta Inc. (2004, 2008)

Common cortical algorithm for all nodes

Learn common spatial patternsLearn common sequences of those patterns

Goal: Create a hierarchical, spatio-temporal model of data

Time is the teacher

Inference (recognition)

Bayesian belief propagationProbability of sequences passed upPredicted spatial patterns passed down

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Structure

Figure: (Maltoni, 2011)Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Structure

Figure: (Maltoni, 2011)

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Structure of a Node

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Learning Algorithms

Spatial pooling

Learning common spatial patterns

Temporal pooling

Learning common sequences of those patterns

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Learning sequence

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Summary of Learning in the HTM Node

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Example of Resulting Representations

Figure: (Maltoni, 2011)

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Goals

strategy of generating training sequences

feedback information flow – covert attention (peripheral visual andmental focus)

complex natural imagesmulti-object recognition

experimenting with the training process

unsupervised pre-training followed be supervised refinement

studying sparse coding for increasing the scalability of HTM

incorporating color

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Goals

strategy of generating training sequences

feedback information flow – covert attention (peripheral visual andmental focus)

complex natural imagesmulti-object recognition

experimenting with the training process

unsupervised pre-training followed be supervised refinement

studying sparse coding for increasing the scalability of HTM

incorporating color

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Goals

strategy of generating training sequences

feedback information flow – covert attention (peripheral visual andmental focus)

complex natural imagesmulti-object recognition

experimenting with the training process

unsupervised pre-training followed be supervised refinement

studying sparse coding for increasing the scalability of HTM

incorporating color

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Goals

strategy of generating training sequences

feedback information flow – covert attention (peripheral visual andmental focus)

complex natural imagesmulti-object recognition

experimenting with the training process

unsupervised pre-training followed be supervised refinement

studying sparse coding for increasing the scalability of HTM

incorporating color

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Goals

strategy of generating training sequences

feedback information flow – covert attention (peripheral visual andmental focus)

complex natural imagesmulti-object recognition

experimenting with the training process

unsupervised pre-training followed be supervised refinement

studying sparse coding for increasing the scalability of HTM

incorporating color

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Article

Stolc, Bajla, Valentın, Skoviera: Pair-Wise Temporal PoolingMethod for Rapid Training of the HTM Networks, Vol. 31, 2012,901–919

64 pixels

Rectangles Triangles Circles

8 pixels

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Codebook Generation

Proposed coordinates Accepted coordinates Codebook

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

Pair-wise Explorer

Smooth explorer Pair-wise explorer

...

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

0

1

2

3 x 104

0

50

100

150

200

250

300

0.4

0.5

0.6

0.7

0.8

0.9C

lass

ifica

tion a

ccura

cy

Number of training

images per object class Number of TAM updates

Spatially specific features

0

1

2

3 x 104

0

50

100

150

200

250

300

0.4

0.5

0.6

0.7

0.8

0.9

Number of TAM updates

Number of training

images per object class

Cla

ssifi

catio

n a

ccura

cy

Bag of features

Pair-wise explorer Smooth explorer

Kristian Valentın Hierarchical Temporal Memory

IntroductionNeocortex

Hierarchical Temporal Memory

HistoryMemory-Prediction Theory of Brain FunctionHierarchical Temporal MemoryGoals

0 0.5 1 1.5 2 2.5 3 3.5 x 1040.98

1

1.02

1.04

1.06

1.08

1.1

1.12

1.14

Spatially specific features

Number of TAM updates

2896 and 4096 TAM updatesA

ccu

racy

ra

tio b

etw

ee

nth

e p

air-w

ise

an

d t

he

sm

oo

th e

xplo

rer

0 0.5 1 1.5 2 2.5 3 3.5 x 1040.98

1

1.02

1.04

1.06

1.08

1.1

1.12

1.14

Bag of features

Number of TAM updates

Accu

racy r

atio

be

twe

en

the

pa

ir-w

ise

an

d t

he

sm

oo

th e

xplo

rer

2896 and 4096 TAM updates

Kristian Valentın Hierarchical Temporal Memory

Thank you for your attention