artificial neural networks 1 morten nielsen department of systems biology, dtu

58
Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Upload: zia

Post on 23-Feb-2016

45 views

Category:

Documents


0 download

DESCRIPTION

Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU. Objectives. Input. Neural network. Output. Neural network: is a black box that no one can understand over-predicts performance Overfitting - many thousand parameters fitted on few data. HUNKAT. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Artificial Neural Networks 1

Morten NielsenDepartment of Systems

Biology,DTU

Page 2: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Input Neural network Output

• Neural network:• is a black box that no one can

understand• over-predicts performance • Overfitting - many thousand

parameters fitted on few data

Objectives

Page 3: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

HUNKAT

Page 4: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 5: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 6: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 7: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Biological Neural network

Page 8: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Biological neuron structure

Page 9: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 10: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Transfer of biological principles to artificial neural network algorithms

• Non-linear relation between input and output• Massively parallel information processing• Data-driven construction of algorithms• Ability to generalize to new data items

Page 11: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 12: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Similar to SMM, except for delta function!

Page 13: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 14: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 15: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

 

How to predict• The effect on the binding affinity

of having a given amino acid at one position can be influenced by the amino acids at other positions in the peptide (sequence correlations). – Two adjacent amino acids may for

example compete for the space in a pocket in the MHC molecule.

• Artificial neural networks (ANN) are ideally suited to take such correlations into account

Page 16: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

SLLPAIVEL YLLPAIVHI TLWVDPYEV GLVPFLVSV KLLEPVLLL LLDVPTAAV LLDVPTAAV LLDVPTAAVLLDVPTAAV VLFRGGPRG MVDGTLLLL YMNGTMSQV MLLSVPLLL SLLGLLVEV ALLPPINIL TLIKIQHTLHLIDYLVTS ILAPPVVKL ALFPQLVIL GILGFVFTL STNRQSGRQ GLDVLTAKV RILGAVAKV QVCERIPTIILFGHENRV ILMEHIHKL ILDQKINEV SLAGGIIGV LLIENVASL FLLWATAEA SLPDFGISY KKREEAPSLLERPGGNEI ALSNLEVKL ALNELLQHV DLERKVESL FLGENISNF ALSDHHIYL GLSEFTEYL STAPPAHGVPLDGEYFTL GVLVGVALI RTLDKVLEV HLSTAFARV RLDSYVRSL YMNGTMSQV GILGFVFTL ILKEPVHGVILGFVFTLT LLFGYPVYV GLSPTVWLS WLSLLVPFV FLPSDFFPS CLGGLLTMV FIAGNSAYE KLGEFYNQMKLVALGINA DLMGYIPLV RLVTLKDIV MLLAVLYCL AAGIGILTV YLEPGPVTA LLDGTATLR ITDQVPFSVKTWGQYWQV TITDQVPFS AFHHVAREL YLNKIQNSL MMRKLAILS AIMDKNIIL IMDKNIILK SMVGNWAKVSLLAPGAKQ KIFGSLAFL ELVSEFSRM KLTPLCVTL VLYRYGSFS YIGEVLVSV CINGVCWTV VMNILLQYVILTVILGVL KVLEYVIKV FLWGPRALV GLSRYVARL FLLTRILTI HLGNVKYLV GIAGGLALL GLQDCTMLVTGAPVTYST VIYQYMDDL VLPDVFIRC VLPDVFIRC AVGIGIAVV LVVLGLLAV ALGLGLLPV GIGIGVLAAGAGIGVAVL IAGIGILAI LIVIGILIL LAGIGLIAA VDGIGILTI GAGIGVLTA AAGIGIIQI QAGIGILLAKARDPHSGH KACDPHSGH ACDPHSGHF SLYNTVATL RGPGRAFVT NLVPMVATV GLHCYEQLV PLKQHFQIVAVFDRKSDA LLDFVRFMG VLVKSPNHV GLAPPQHLI LLGRNSFEV PLTFGWCYK VLEWRFDSR TLNAWVKVVGLCTLVAML FIDSYICQV IISAVVGIL VMAGVGSPY LLWTLVVLL SVRDRLARL LLMDCSGSI CLTSTVQLVVLHDDLLEA LMWITQCFL SLLMWITQC QLSLLMWIT LLGATCMFV RLTRFLSRV YMDGTMSQV FLTPKKLQCISNDVCAQV VKTDGNPPE SVYDFFVWL FLYGALLLA VLFSSDFRI LMWAKIGPV SLLLELEEV SLSRFSWGAYTAFTIPSI RLMKQDFSV RLPRIFCSC FLWGPRAYA RLLQETELV SLFEGIDFY SLDQSVVEL RLNMFTPYINMFTPYIGV LMIIPLINV TLFIGSHVV SLVIVTTFV VLQWASLAV ILAKFLHWL STAPPHVNV LLLLTVLTVVVLGVVFGI ILHNGAYSL MIMVKCWMI MLGTHTMEV MLGTHTMEV SLADTNSLA LLWAARPRL GVALQTMKQGLYDGMEHL KMVELVHFL YLQLVFGIE MLMAQEALA LMAQEALAF VYDGREHTV YLSGANLNL RMFPNAPYLEAAGIGILT TLDSQVMSL STPPPGTRV KVAELVHFL IMIGVLVGV ALCRWGLLL LLFAGVQCQ VLLCESTAVYLSTAFARV YLLEMLWRL SLDDYNHLV RTLDKVLEV GLPVEYLQV KLIANNTRV FIYAGSLSA KLVANNTRLFLDEFMEGV ALQPGTALL VLDGLDVLL SLYSFPEPE ALYVDSLFF SLLQHLIGL ELTLGEFLK MINAYLDKLAAGIGILTV FLPSDFFPS SVRDRLARL SLREWLLRI LLSAWILTA AAGIGILTV AVPDEIPPL FAYDGKDYIAAGIGILTV FLPSDFFPS AAGIGILTV FLPSDFFPS AAGIGILTV FLWGPRALV ETVSEQSNV ITLWQRPLV

MHC peptide binding

Page 17: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

• How is mutual information calculated?• Information content was calculated as

• Gives information in a single position

• Similar relation for mutual information• Gives mutual information between two positions

Mutual information

Page 18: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Mutual information. Example

ALWGFFPVAILKEPVHGVILGFVFTLTLLFGYPVYVGLSPTVWLSYMNGTMSQV GILGFVFTL WLSLLVPFVFLPSDFFPS

P1 P6

P(G1) = 2/9 = 0.22, ..P(V6) = 4/9 = 0.44,..P(G1,V6) = 2/9 = 0.22, P(G1)*P(V6) = 8/81 = 0.10

log(0.22/0.10) > 0

Knowing that you have G at P1 allows you to make an educated guess on what you will find at P6. P(V6) = 4/9. P(V6|G1) = 1.0!

Page 19: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

 

313 binding peptides 313 random peptides

Mutual information

Page 20: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Higher order sequence correlations

• Neural networks can learn higher order correlations!– What does this mean?

S S => 0L S => 1S L => 1L L => 0

Say that the peptide needs one and only one large amino acid in the positions P3 and P4 to fill the binding cleft

How would you formulate this to test if a peptide can bind?

=> XOR function

Page 21: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Neural networks

• Neural networks can learn higher order correlations

XOR function:0 0 => 01 0 => 10 1 => 11 1 => 0

(1,1)

(1,0)(0,0)

(0,1)

No linear function can separate the points OR

AND

XOR

Page 22: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Error estimates

XOR 0 0 => 01 0 => 10 1 => 11 1 => 0

(1,1)

(1,0)(0,0)

(0,1)Predict0111

Error0001

Mean error: 1/4

Page 23: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Neural networks

v1 v2

Linear function

Page 24: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Neural networks with a hidden layer

w12

v1

w21 w2

2

v2

1

wt2

wt1w11

1

vt

Input 1 (Bias){

Page 25: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Neural networks

Page 26: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

How does it work? Ex. Input is (0 0)

0 06

-9

4 6

9

1

-2-64

1

-4.5

Input 1 (Bias){

o1=-6O1=0

o2=-2O2=0

y1=-4.5Y1=0

Page 27: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Neural networks. How does it work?

Hand out

Page 28: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

XOR function:0 0 => 01 0 => 10 1 => 11 1 => 0

6

-9

4 6

9

1

-2-64

1

-4.5

Input 1 (Bias)

{y2 y1

What is going on?

Page 29: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

(1,1)

(1,0)(0,0)

(0,1)x2

x1 y1

y2

(1,0)

(2,2)

(0,0)

What is going on?

Page 30: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 31: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 32: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 33: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Training and error reduction

Page 34: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Training and error reduction

Page 35: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Training and error reduction

Size matters

Page 36: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

• A Network contains a very large set of parameters

– A network with 5 hidden neurons predicting binding for 9meric peptides has 9x20x5=900 weights

– 5 times as many weights as a matrix-based method

• Over fitting is a problem• Stop training when test performance is optimal (use early stopping)

Neural network training

yearsTe

mpe

ratu

re

Page 37: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Neural network training. Cross validation

Cross validation

Train on 4/5 of dataTest on 1/5=>Produce 5 different neural networks each with a different prediction focus

Page 38: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Neural network training curve

Maximum test set performanceMost cable of generalizing

Page 39: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Demo

Page 40: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Network training

• Encoding of sequence data– Sparse encoding– Blosum encoding– Sequence profile encoding

Page 41: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Sparse encoding

Inp Neuron 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20AAcidA 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0R 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 N 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0D 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0C 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Q 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0E 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0

Page 42: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

BLOSUM encoding (Blosum50 matrix)

A R N D C Q E G H I L K M F P S T W Y V A 4 -1 -2 -2 0 -1 -1 0 -2 -1 -1 -1 -1 -2 -1 1 0 -3 -2 0R -1 5 0 -2 -3 1 0 -2 0 -3 -2 2 -1 -3 -2 -1 -1 -3 -2 -3N -2 0 6 1 -3 0 0 0 1 -3 -3 0 -2 -3 -2 1 0 -4 -2 -3D -2 -2 1 6 -3 0 2 -1 -1 -3 -4 -1 -3 -3 -1 0 -1 -4 -3 -3C 0 -3 -3 -3 9 -3 -4 -3 -3 -1 -1 -3 -1 -2 -3 -1 -1 -2 -2 -1Q -1 1 0 0 -3 5 2 -2 0 -3 -2 1 0 -3 -1 0 -1 -2 -1 -2E -1 0 0 2 -4 2 5 -2 0 -3 -3 1 -2 -3 -1 0 -1 -3 -2 -2G 0 -2 0 -1 -3 -2 -2 6 -2 -4 -4 -2 -3 -3 -2 0 -2 -2 -3 -3H -2 0 1 -1 -3 0 0 -2 8 -3 -3 -1 -2 -1 -2 -1 -2 -2 2 -3I -1 -3 -3 -3 -1 -3 -3 -4 -3 4 2 -3 1 0 -3 -2 -1 -3 -1 3L -1 -2 -3 -4 -1 -2 -3 -4 -3 2 4 -2 2 0 -3 -2 -1 -2 -1 1K -1 2 0 -1 -3 1 1 -2 -1 -3 -2 5 -1 -3 -1 0 -1 -3 -2 -2M -1 -1 -2 -3 -1 0 -2 -3 -2 1 2 -1 5 0 -2 -1 -1 -1 -1 1F -2 -3 -3 -3 -2 -3 -3 -3 -1 0 0 -3 0 6 -4 -2 -2 1 3 -1P -1 -2 -2 -1 -3 -1 -1 -2 -2 -3 -3 -1 -2 -4 7 -1 -1 -4 -3 -2S 1 -1 1 0 -1 0 0 0 -1 -2 -2 0 -1 -2 -1 4 1 -3 -2 -2T 0 -1 0 -1 -1 -1 -1 -2 -2 -1 -1 -1 -1 -2 -1 1 5 -2 -2 0W -3 -3 -4 -4 -2 -2 -3 -2 -2 -3 -2 -3 -1 1 -4 -3 -2 11 2 -3Y -2 -2 -2 -3 -2 -1 -2 -3 2 -1 -1 -2 -1 3 -3 -2 -2 2 7 -1V 0 -3 -3 -3 -1 -2 -2 -3 -3 3 1 -2 1 -1 -2 -2 0 -3 -1 4

Page 43: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Sequence encoding (continued)

• Sparse encoding– V:0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1– L:0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0

– V.L=0 (unrelated)• Blosum encoding

– V: 0 -3 -3 -3 -1 -2 -2 -3 -3 3 1 -2 1 -1 -2 -2 0 -3 -1 4

– L:-1 -2 -3 -4 -1 -2 -3 -4 -3 2 4 -2 2 0 -3 -2 -1 -2 -1 1 – V.L = 0.88 (highly related)– V.R = -0.08 (close to unrelated)

Page 44: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

The Wisdom of the Crowds• The Wisdom of Crowds. Why the Many

are Smarter than the Few. James Surowiecki

One day in the fall of 1906, the British scientist Fracis Galton left his home and headed for a

country fair… He believed that only a very few people had the characteristics necessary to keep

societies healthy. He had devoted much of his career to measuring those characteristics, in fact, in order to prove that the vast majority of people

did not have them. … Galton came across a weight-judging competition…Eight hundred people tried

their luck. They were a diverse lot, butchers, farmers, clerks and many other no-experts…The

crowd had guessed … 1.197 pounds, the ox weighted 1.198

Page 45: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Network ensembles• No one single network with a particular

architecture and sequence encoding scheme, will constantly perform the best

• Also for Neural network predictions will enlightened despotism fail – For some peptides, BLOSUM encoding with a four

neuron hidden layer can best predict the peptide/MHC binding, for other peptides a sparse encoded network with zero hidden neurons performs the best

– Wisdom of the Crowd• Never use just one neural network• Use Network ensembles

Page 46: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Evaluation of prediction accuracy

ENS: Ensemble of neural networks trained using sparse, Blosum, and weight matrix sequence encoding

Page 47: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Applications of artificial neural networks

• Talk recognition• Prediction of protein secondary

structure• Prediction of Signal peptides • Post translation modifications

– Glycosylation– Phosphorylation

• Proteasomal cleavage• MHC:peptide binding

Page 48: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU
Page 49: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Prediction of protein secondary structure

• Benefits– General applicable– Can capture higher order correlations– Inputs other than sequence information

• Drawbacks– Needs many data (different solved

structures).• However, these does exist today (more than

2500 solved structures with low sequence identity/high resolution)

– Complex method with several pitfalls

Page 50: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

ß-strandHelix

TurnBend

Secondary Structure Elements

Page 51: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Sparse encoding of amino acid sequence windows

Page 52: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

How is it done• One network (SEQ2STR) takes sequence (profiles) as

input and predicts secondary structure– Cannot deal with SS elements i.e. helices are normally

formed by at least 5 consecutive amino acids• Second network (STR2STR) takes predictions of first

network and predicts secondary structure– Can correct for errors in SS elements, i.e remove single

helix prediction, mixture of strand and helix predictions

Page 53: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Architecture

IKEEHVI IQAE

HEC

IKEEHVIIQAEFYLNPDQSGEF…..Window

Input Layer

Hidden Layer

Output Layer

Weights

Page 54: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Secondary networks(Structure-to-Structure)

HECHECHEC

HEC

IKEEHVIIQAEFYLNPDQSGEF…..

Window

Input Layer

Hidden Layer

Output Layer

Weights

Page 55: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Example

PITKEVEVEYLLRRLEE (Sequence)HHHHHHHHHHHHTGGG. (DSSP)ECCCHEEHHHHHHHCCC (SEQ2STR)CCCCHHHHHHHHHHCCC (STR2STR)

Page 56: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Why so many networks?

Q3 is the overall accuracy

Page 57: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

Why not select the best?

Page 58: Artificial Neural Networks 1 Morten Nielsen Department of Systems Biology, DTU

What have we learned?

• Neural networks are not so bad as their reputation

• Neural networks can deal with higher order correlations

• Be careful when training a neural network– Always use cross validated training