<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Science Archives &mdash; Tim Dettmers</title>
	<atom:link href="https://timdettmers.com/category/science/feed/" rel="self" type="application/rss+xml" />
	<link>https://timdettmers.com/category/science/</link>
	<description>Making deep learning accessible.</description>
	<lastBuildDate>Fri, 31 Dec 2021 19:30:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.11</generator>

<image>
	<url>https://i0.wp.com/timdettmers.com/wp-content/uploads/2025/12/cropped-profile_2026_400x400.png?fit=32%2C32&#038;ssl=1</url>
	<title>Science Archives &mdash; Tim Dettmers</title>
	<link>https://timdettmers.com/category/science/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">106749684</site>	<item>
		<title>On Creativity in Academia</title>
		<link>https://timdettmers.com/2019/09/03/creativity-in-academia/</link>
					<comments>https://timdettmers.com/2019/09/03/creativity-in-academia/#comments</comments>
		
		<dc:creator><![CDATA[Tim Dettmers]]></dc:creator>
		<pubDate>Tue, 03 Sep 2019 12:05:19 +0000</pubDate>
				<category><![CDATA[Academia]]></category>
		<category><![CDATA[PhD Life]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[PhD]]></category>
		<guid isPermaLink="false">https://timdettmers.com/?p=796</guid>

					<description><![CDATA[<p>I recently had a discussion about creativity with a colleague. We were discussing music and how creative many bands and groups are. At the end of our conversation, my friend told me, half-sarcastic-half-serious, how much more creative the people in the music industry are than him and that he just cannot find good ideas in [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2019/09/03/creativity-in-academia/">On Creativity in Academia</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I recently had a discussion about creativity with a colleague. We were discussing music and how creative many bands and groups are. At the end of our conversation, my friend told me, half-sarcastic-half-serious, how much more creative the people in the music industry are than him and that he just cannot find good ideas in his area of research even though he tried so hard for such a long time. I was a bit surprised because I thought of him as someone very creative. However, it is not uncommon to hear scientists lament about their lack of creativity compared to academic superstars. I think about creativity in academia is a bit distorted and a straight view can help to feel less bad about one&#8217;s own creativity.</p>
<p><span id="more-796"></span></p>
<p>This blog post is part of a series of blog posts about scientific thinking in deep learning, natural language processing and science in general. I am currently on vacation in China, and I wanted to relax a bit by writing down some reflective blog posts which capture the thoughts that were lingering in my mind for weeks or months.</p>
<h2>Are Theoretical Physicists Creative?</h2>
<p>I think the paradox that very creative people think they are not creative is best demonstrated by looking at theoretical physicists and compare them to children. In psychological research, it is well known that children score much better on many tasks of divergent thinking than adults do: They do not think about the limitations of an object so that a brick which is used for building buildings is suddenly a tool for weight training, or a door stopper, or a paperweight, and so forth. If you ask people to build towers of spaghetti and marshmallows children do better than adults because they are not limited by what they think a structure of a tower should look like. But all of this is mere idea generation. Is this really creativity?</p>
<p>There is another famous case of similar creativity among physicists which might shine a light on what the boundary between idea generation and creativity in research is: The undergrad theory of everything. It is a common problem for academics in physics to be tortured by undergrads who just invented &#8220;a new theory of physics which can unify gravity and quantum mechanics&#8221;. The problem here is that the undergrads do not yet have the proper knowledge to understand the intricate relationships among equations to understand what is permissible and what is not. They see the brick as a door stopper, when in fact a brick is used for building buildings and paving walkways. An important part of creativity is to understand what are bad ideas — some physics undergrads think it is just about idea generation. Do not get me wrong, idea generation is important, but it is not the most important part of creativity in academia.</p>
<p>This can go to an extreme if you work in theoretical physics and other fields where ideas are severely constrained by proper thought. There are so many bad ideas and so few good ideas that nobody really is coming up with anything good anymore. However, it would be ludicrous to say that people like Edward Witten are not creative because he did not come up with any good ideas since string theory. Similarly, Albert Einstein labored for decades trying to unify gravity and quantum mechanics only to come up with nothing. Bertrand Russel would often take a sheet of paper in the morning and work on a logical problem and write down whenever he found a useful thought. Most often the paper was still blank in the evening. So if you see creativity as idea generation, Albeit Einstein and others should be seen as failures compared to the children that churn out ideas. This demonstrates that the view of creativity as idea generation is problematic.</p>
<p>One thing that has to be understood when thinking about creativity is that some fields of thought are highly constrained in terms of which ideas are valid. To come by a good idea is a very lengthy and labor-intensive process. Other fields, like music, are very free in their expression and you can take any two ideas which do not seem to be related at all, mash them together, and with a little bit of work you can make it sound nice. I am exaggerating, but you get the idea.</p>
<p>Some fields, like machine translations, are now more and more constrained and good ideas need a team of people equipped with large computational resources that collaborate effectively for a long time come up with, and verify an idea which will yield a tiny improvement. One can expect the constrains on ideas increase exponentially with time in any given sub-field — just like it did in experimental physics. However, while finding valid ideas is becoming exponentially more difficult these fields also spawn new sub-fields as offspring. In these new fields, it will be very easy to come up with new ideas since — similarly to the music industry — anything is valid. As the field progresses the idea space becomes more and more constraint and finding valid ideas is much more important than generating just any idea. If you work in an area which is very constrained, you should have more compassion with yourself. Creativity is not just about generating some imaginative ideas — it is more about finding strange ideas which are still valid.</p>
<h2>&#8220;Not Coming Up with Good Ideas&#8221; is Essential for Creativity</h2>
<p>Expertise is important and a requirement for creativity. You need to be able to understand what are valid ideas and which are not. The next step is to loosen up the boundaries between ideas that may seem unconnected at first glance. Psychological research says, that once one has one of these strange ideas it is important to hammer on it over and over to exhaustion. The idea will reshape itself from one form to the next and eventually, you will probably fail to come up with something reasonable that works. Science says, that this is normal and the further insights are made unconsciously. After you give up an idea, your unconscious mind is still in the process of piecing together the puzzle and you might arrive at something useful over time. With the next puzzle piece put into place by your unconscious mind, you might be able to make some progress on an idea which might lead to a working valid idea.</p>
<p>Many researchers fail in the creative process because they do not understand it well. They feel like failures if their ideas fail. But the process of hammering on ideas and not making any progress is the first part of creativity. Only if you know all the ways that do not work can you come up with the solutions that nobody else is seeing. The second step is often abandoning the idea for some time. Some researchers feel that if an idea did not work out and you abandon the idea you also failed and it is a sign of not having creativity. But this step can be a critical element of creativity. It is important to have phases in which you do not think about an idea so your unconscious mind can make the connections that your conscious mind cannot see. The next step is to pick up a failed idea and try again. The unconscious insights are revealed in this way and you might quickly have a way to get an idea to work.</p>
<p>Another problem with the creative process is that researchers often work on a single idea. Instead, it is much more effective to work on many ideas. One idea for you to work on actively, while the other ideas are in the back of your mind and provide enough material for your unconscious mind to churn on. These ideas do not need to be totally different from each other, just different enough to not bother your conscious mind while you work on another idea.</p>
<p>I think to have a sane creative process, it is essential to acknowledge and even embrace this long-winded exhausting struggle with multiple rounds of failure as an essential part of creativity.</p>
<h2>Conclusion</h2>
<p>Researchers are often very harsh critics of themselves in terms of creativity. They do not come up with good ideas or with too few ideas or their ideas do not work out. But this does not mean that you are not creative. Some fields of research are very constraint in what ideas are valid and it is expected that the raw quantity of ideas in these fields is low. Furthermore, making no progress and abandoning an idea to work on something else are essential parts of creativity and should be celebrated and embraced. The next time you fail to make progress and think about abandoning an idea you should give yourself a pat on the back — you just reached the first milestone to come up with a great idea!</p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2019/09/03/creativity-in-academia/">On Creativity in Academia</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://timdettmers.com/2019/09/03/creativity-in-academia/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">796</post-id>	</item>
		<item>
		<title>Credit Assignment in Deep Learning</title>
		<link>https://timdettmers.com/2017/09/16/credit-assignment-deep-learning/</link>
					<comments>https://timdettmers.com/2017/09/16/credit-assignment-deep-learning/#comments</comments>
		
		<dc:creator><![CDATA[Tim Dettmers]]></dc:creator>
		<pubDate>Sat, 16 Sep 2017 17:17:00 +0000</pubDate>
				<category><![CDATA[Academia]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[PhD]]></category>
		<guid isPermaLink="false">http://timdettmers.com/?p=596</guid>

					<description><![CDATA[<p>This morning I got an email about my blog post discussing the history of deep learning which rattled me back into a time of my academic career which I rather not think about. It was a low point which nearly ended my Master studies at the University of Lugano, and it made me feel so [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2017/09/16/credit-assignment-deep-learning/">Credit Assignment in Deep Learning</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This morning I got an email about my blog post discussing the <a href="https://developer.nvidia.com/blog/deep-learning-nutshell-history-training/">history of deep learning </a>which rattled me back into a time of my academic career which I rather not think about. It was a low point which nearly ended my Master studies at the University of Lugano, and it made me feel so bad about blogging that I took two long years to recover. So what has happened?</p>
<p><span id="more-596"></span></p>
<p>When I started my masters, I worked on blog posts for NVIDIA which featured introductions into deep learning. Part of this blog post series also discusses the history of deep learning. I hence discussed what I thought to be the historical milestones with the largest impact but in doing so, I inadvertently assigned credit to researchers that I thought had a good impact on the field. I worked on this blog post and circulated it in my deep learning class&#8217;s forums to the dismay of my then advisor who holds the opposite view of mine.</p>
<p>To evaluate the credit that a research idea deserves, I believe that it is not only important who has the first idea, but I also believe that it is equally important to actually make it work (the implementation). My ex-advisor believed that it only really matters who was the first who published the idea.</p>
<p>My advisor scolded me in class for my views since he felt very strongly that the first idea counts and that my view is plain wrong. To redeem myself and to salvage the relationship with him, I felt coerced to change my blog post to his wishes.</p>
<p>This quasi-censorship of my blog post eviscerated me, and in consequence, I lost all desire to blog for two years. Despite my efforts, the relationship with my then advisor deteriorated further, and I had to look for a new advisor.</p>
<p>Looking back at the blog post that I produced, I feel ashamed. It does not express my personal views. I value integrity, and my behavior did not reflect who I want to be.</p>
<p>I write this blog post to discuss my true beliefs about credit assignment and why I believe that the idea, its communication and its implementation are all equally important.</p>
<h1>Who Deserves Credit for Deep Learning Ideas?</h1>
<p>There has been a lot of discussion about how to assign credit to researchers, or in other words, how to determine whose work had a large impact. Note that I do not discuss here who deserves credit for discovering an idea, I look at who deserves credit for the impact that an idea has. Looking at this, there are two main camps: The first believes that ideas and implementation count equally, and, the second believes that it counts who had the ideas first.</p>
<p>The problem with this discussion is that it is not a scientific topic, but a philosophical one. How do we determine what has how much value? We use the scientific method. What is the scientific method in philosophy? Use reductions to arrive at simple statements, then use logic to derive other factual statements, failing that — like in this case — we make thought experiments where we isolate variables which we then take to extremes. Let&#8217;s do this now to get insight into the issue.</p>
<h2>All Ideas, No Communication, No Implementation</h2>
<p>Let&#8217;s imagine there exists a person that has come up with all ideas in deep learning of the past and all ideas in deep learning of the future. However, this person cannot communicate&nbsp;with either words or writing. This person also cannot write code. How much credit deserves such a person?</p>
<p>I would argue that such a person deserves zero credit. In fact, I think it is epistemologically correct that this person deserves no credit because nobody can know that he or she deserves credit.</p>
<h2>All Ideas, 1 Communication + No Ideas, Full Communication</h2>
<p>We have a Person 1 that invented everything in deep learning. Now this person can communicate, but he or she is so unclear that only a single Person 2 can understand these ideas.</p>
<p>Now, Person 2 has no creativity but is a perfect communicator. Person 2 basically just translates what Person 1 said and the entire world understands. Who deserves credit here?</p>
<p>It is tempting to think that Person 2 deserves all the credit because Person 1 is useless without Person 2. But similarly, Person 2 is useless without Person 1.</p>
<p>Both people thus deserve equal credit — no one can achieve anything without the other.</p>
<h2>All Ideas, Full Communication, 1 Implementation</h2>
<p>Let&#8217;s increase the complexity of the problem. Let us say the duo of Person 1 and Person 2 spread the ideas so that the entire world understands deep learning, but let us assume that all people are implementation agnostic. Nobody can make deep learning work. The world knows about all deep learning ideas but cannot solve any problem with it. In such a world, the ideas of deep learning are quickly abandoned by the large majority due to their uselessness (just like the majority of the population does not care much about pure mathematics, e.g., few care if&nbsp;<span class="texhtml">a<sup>n</sup> + b<sup>n</sup> = c<sup>n</sup></span>&nbsp;is true for all integer n &gt;2).</p>
<p>Enter Person 3. Person 3 has no creativity, cannot communicate, but he or she can implement all the deep learning ideas in a practical manner. The world looks at this person&#8217;s code and suddenly is able to solve all problems which are solvable with deep learning.</p>
<p>Who deserves the most credit: Person 1, Person 2, or Person 3?</p>
<p>As discussed before, Person 1 and Person 2 deserve equal credit, and also here, I would argue, that Person 3 deserves equal credit.</p>
<p>This becomes apparent when we think about the value of ideas. Ideas are useful when they have an affect. If they have no or only a small effect they just deserve no recognition or little recognition. If deep learning ideas have no practical value then they would not deserve more recognition than, say, the idea that there might be something beyond the observable universe — it is a nice idea, but it will never produce anything of much value.</p>
<h1>Comparative Individual Value For Collective Contributions</h1>
<p>The evaluation changes if we distribute the contributions of ideas, communication, and implementation among many individuals. If we can take the three scenarios above, expand Person 1-3 into groups of people and subject them to comparative evaluation, that is, how much value the contributions of each individual has compared to all the other people have we arrive at the following thought experiment.</p>
<h2>1 Ideas, 1000 Communication, 1000 Implementation</h2>
<p>We have 1 person who has all the ideas, 1000 people who can understand these ideas and communicate them to the world, and 1000 people who can implement them to yield practical value, then how do we assign credit?</p>
<p>As discussed it is reasonable that each of the areas, (1) ideas, (2) communication, (3) implementation deserve equal credit. If now the groups of 1000 people made contributions (communications and implementations) of equal value, it would be fair to say that:</p>
<ul>
<li>1 Ideas: 1/3 credit</li>
<li>1000 Communication: 1/3000 credit each</li>
<li>1000 Implementation: 1/3000 credit each.</li>
</ul>
<p>We see in this case the one person with the idea should receive the largest amount of credit.</p>
<p>Similarly, if we weight the numbers differently, and if we assume contributions of individuals in groups are equal, then this credit assignment holds for all other combinations like (1000, 1, 1000), or (10000, 1000, 1).</p>
<h1>Timing and Relational Effects</h1>
<p>In the real world, we have timing effects and relational effects. Not all 1000 Ideas, Communication, or Implementation people will publish their work at the same time, but they will have a specific sequence. In this sequence, they will influence and build on each other — they stand on the shoulders of giants. Who are the giants? Who deserves what amount of credit?</p>
<p>If we think about it, it is not much different than our first analysis. Lets take Person 1 that only has ideas and can communicate his or her ideas to only one other Person 2; Person 2, standing on Person 1&#8217;s shoulders, is only able to communicate the ideas to another person Person 3; Person 3, standing on Person 2&#8217;s shoulders, in turn, can communicate the ideas clearly to the entire world.</p>
<p>If we express the ability of people as numbers which represent the fraction of all value ideas, communication, and implementation we could weight Person 1, Person 2, and Person 3 in this way:</p>
<ul>
<li>Person1: [1, 1/10^10, 0]</li>
<li>Person2: [0, 1/10^10, 0]</li>
<li>Person3: [0, 1, 0]</li>
</ul>
<p>Which means that Person 1, has all the ideas (1), could communicate these ideas to 1 person (we assume a total population of 10 billion people to make the math easier). Person 2 has no ideas, could understand Person 1&#8217;s idea but could only communicate this idea to one other person, Person 3. Person 3 has no ideas, understands the idea of Person 2 and can communicate it so that everybody understands. Note that this example is simplified so that all people are implementation agnostic.</p>
<p>From these fractions, we see that Person 2 has almost no fraction of contributions since Person 2 is not creative and also not a good communicator. However, if we look at the relational effects we know Person 3 would have no value without Person 2, and Person 1 would also have no value without Person 2. So how do we solve this credit assignment problem?</p>
<p>We can try to solve this problem by expressing it as a weighted graph which expressed relationships over time and the relationships of the fractions with respect to the world.</p>
<figure id="attachment_602" aria-describedby="caption-attachment-602" style="width: 534px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2017/09/relational_example-3.png"><img data-attachment-id="602" data-permalink="https://timdettmers.com/2017/09/16/credit-assignment-deep-learning/relational_example-4/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2017/09/relational_example-3.png?fit=534%2C449&amp;ssl=1" data-orig-size="534,449" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="relational_example" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2017/09/relational_example-3.png?fit=300%2C252&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2017/09/relational_example-3.png?fit=534%2C449&amp;ssl=1" class="wp-image-602 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2017/09/relational_example-3.png?resize=534%2C449" alt="" width="534" height="449" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2017/09/relational_example-3.png?w=534&amp;ssl=1 534w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2017/09/relational_example-3.png?resize=300%2C252&amp;ssl=1 300w" sizes="(max-width: 534px) 100vw, 534px" data-recalc-dims="1" /></a><figcaption id="caption-attachment-602" class="wp-caption-text">Graphical representation of this particular credit assignment problem: The world has 10^10 people (self-weight: 1). Person 1 (P1) has all the ideas that exist in the world (1) and can communicate to one other person in the world (1/10^10), that is P2 (1); P2 can communicate the ideas to one person in the world (1/10^10), which is P3 (1); P3 can communicate the idea to the entire world in an understandable way (1). Connections between P1-P2, and P2-P3 are bidirectional, meaning that it is important (a) to understand and (b) to communicate ideas.</figcaption></figure>
<p>How we weight the contribution of each&nbsp;person in this case? There are many answers to this, but here PageRank would be a good fit. PageRank works exactly as we discussed above, the credit is assigned&nbsp;comparatively, that is if we have a (1, 1000, 1000) distribution, the largest chunk of PageRank will be distributed by the single person. Thus it reflects our evaluation system. PageRank also takes into account the relationships between nodes and their recursive weight (standing on the shoulders of giants).</p>
<p>Using the scenario above, we find the contributions as follows:</p>

<table id="tablepress-2" class="tablepress tablepress-id-2">
<thead>
<tr class="row-1 odd">
	<th class="column-1">Name</th><th class="column-2">PageRank</th><th class="column-3">Relative Contribution</th>
</tr>
</thead>
<tbody class="row-hover">
<tr class="row-2 even">
	<td class="column-1">P2</td><td class="column-2">0.3450</td><td class="column-3">0.4319</td>
</tr>
<tr class="row-3 odd">
	<td class="column-1">P1</td><td class="column-2">0.2697</td><td class="column-3">0.3376</td>
</tr>
<tr class="row-4 even">
	<td class="column-1">P3</td><td class="column-2">0.1841</td><td class="column-3">0.2305</td>
</tr>
</tbody>
</table>
<!-- #tablepress-2 from cache -->
<p>We see that P2 has the largest contribution despite being only the bridge between P1 and P3 who have the largest fractions (all the ideas and full communication abilities). However, P1&#8217;s success depends on P2, and P3&#8217;s success depends on P2 and as such P2 is the most critical link in the entire system.</p>
<p>This is quite insightful. If you understand some obscure research and communicate this to just a few&nbsp;researchers who, in turn, influence many other researchers then you will have made a substantial contribution to the deep learning community.</p>
<p>It would not feel this way because you will probably not experience any fame or recognition here. The recognition will come for P1 (having ideas) and P3 (communicating ideas). But still, the numbers do not lie here.</p>
<p>This experiment was quite interesting, and if you want to experiment&nbsp;a bit by yourself, you can&nbsp;<a href="https://github.com/TimDettmers/CreditAssignment">download the code</a> to see what happens if you add more people and more relationships among these people. This exercise can give quite some insight into what is valuable for research.</p>
<h1>Response to Criticism on Reddit</h1>
<p>There has been some <a href="https://www.reddit.com/r/MachineLearning/comments/70j88n/d_credit_assignment_in_deep_learning_tim_dettmers/">sharp criticism on Reddit</a> concerning ideas expressed in this blog post. The user metacurse makes the point that in science we credit usually those researchers who had the idea first and that communication and implementation are not valued. For example we value Albert Einstein more highly for the discovery of general relativity and the photoelectric effect and not its communication by Neil deGrasse Tyson; similarly, Cocks is credited for RSA even though he never implemented it in any way that was widely used (and he could not produce public implementations due to the classified status of RSA). However, this entire argument is rather weak and unfair:</p>
<ul>
<li>I do not discuss who should be credited for an idea or the usage of the idea, I discuss who should be credited for the overall <em>impact</em> of an idea. These are very different questions.</li>
<li>He uses examples to try to prove his own hypothesis when we know that <a href="https://en.wikipedia.org/wiki/Problem_of_induction">examples cannot prove anything</a>&nbsp;(he uses classical philosophic techniques, which has some value, but it does not generate any reliable knowledge like analytical philosophy does). He mocks me for not using examples myself.</li>
<li>He appeals to the emotion of the readers, by saying that my views endorse unethical ideas like &#8220;stealing olds ideas and rebranding them as your own&#8221; when it has nothing to do with my argument (reductio ad Hitlerum). He does this quite successfully swaying many emotional readers. I do not think this is helpful.</li>
</ul>
<p>To make a sharper contrast why metacurse&#8217;s argument is not relevant to mine take this thought experiment.</p>
<p>We have a super genius who knows about all possible ideas and writes them down so that everybody can understand it easily. Then she locks these notes away in a locker and dies the next second. Over the next billions of years humanity rediscovers all ideas and uses them to build a flourishing society where all living things live in harmony and every being is fulfilled and so forth. One second before the last human dies in heat death, that human discovers the notebook.</p>
<p>Metacurse&#8217;s argument would look for the answer to the question: Should our super genius be credited for inventing everything? Metacurse would argue, yes, and I would totally agree.</p>
<p>What I discuss in this blog post: How much impact did our super genius have on the overall impact of all ideas? Very little, she never had any direct or even indirect effect with any of the ideas; the only impact she had was that one other person understood that she had the ideas before others had them. That is the total impact of her ideas. Her impact is almost zero.</p>
<h1>Conclusion</h1>
<p>Here I discussed how it is best to think about contributions in deep learning. From thought experiments, we could see that ideas, their communication, and their implementation are equally important contributions.</p>
<p>We also discussed how timing effects and dependencies could be modeled in a relational graph. We found that people that link ideas to communicators can make substantial contributions to the research community even if they themselves are not creative or good communicators. Creating the links between influential ideas and influential communicators (or people that implement) are important here.</p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2017/09/16/credit-assignment-deep-learning/">Credit Assignment in Deep Learning</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://timdettmers.com/2017/09/16/credit-assignment-deep-learning/feed/</wfw:commentRss>
			<slash:comments>15</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">596</post-id>	</item>
		<item>
		<title>The Brain vs Deep Learning Part I: Computational Complexity — Or Why the Singularity Is Nowhere Near</title>
		<link>https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/</link>
					<comments>https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/#comments</comments>
		
		<dc:creator><![CDATA[Tim Dettmers]]></dc:creator>
		<pubDate>Mon, 27 Jul 2015 10:20:05 +0000</pubDate>
				<category><![CDATA[Deep Learning]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Neuroscience]]></category>
		<category><![CDATA[Convolution]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[High Performance Computing]]></category>
		<guid isPermaLink="false">https://timdettmers.wordpress.com/?p=312</guid>

					<description><![CDATA[<p>In this blog post I will delve into the brain and explain its basic information processing machinery and compare it to deep learning. I do this by moving step-by-step along with the brains electrochemical and biological information processing pipeline and relating it directly to the architecture of convolutional nets. Thereby we will see that a neuron and a convolutional net are very similar information processing machines. While performing this comparison, I will also discuss the computational complexity of these processes and thus derive an estimate for the brains overall computational power. I will use these estimates, along with knowledge from high performance computing, to show that it is unlikely that there will be a technological singularity in this century.</p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/">The Brain vs Deep Learning Part I: Computational Complexity — Or Why the Singularity Is Nowhere Near</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this blog post I will delve into the brain and explain its basic information processing machinery and compare it to deep learning. I do this by moving step-by-step along with the brains electrochemical and biological information processing pipeline and relating it directly to the architecture of convolutional nets. Thereby we will see that a neuron and a convolutional net are very similar information processing machines. While performing this comparison, I will also discuss the computational complexity of these processes and thus derive an estimate for the brains overall computational power. I will use these estimates, along with knowledge from high performance computing, to show that it is unlikely that there will be a technological singularity in this century.</p>
<p><span id="more-312"></span></p>
<p>This blog post is complex as it arcs over multiple topics in order to unify them into a coherent framework of thought. I have tried to make this article as readable as possible, but I might have not succeeded in all places. Thus, if you find yourself in an unclear passage it might become clearer a few paragraphs down the road where I pick up the thought again and integrate it with another discipline.</p>
<p>First I will give a brief overview about the predictions for a technological singularity and topics which are aligned with that. Then I will start the integration of ideas between the brain and deep learning. I finish with discussing high performance computing and how this all relates to predictions about a technological singularity.</p>
<p>The part which compares the brains information processing steps to deep learning is self-contained, and readers which are not interested in predictions for a technological singularity may skip to this part.</p>
<h2>Part I: Evaluating current predictions of a technological singularity</h2>
<p>There were a lot of headlines recently about predictions that artificial intelligence will reach super-human intelligence as early as 2030 and that this might herald the beginning of human extinction, or at least dramatically altering everyday life. How was this prediction made?</p>
<h3>Factors which help to predict a singularity</h3>
<p>Ray Kurzweil has made many very accurate <a href="https://en.wikipedia.org/wiki/Predictions_made_by_Ray_Kurzweil#2029">predictions</a> and his methods to reach these predictions are quite simple for computing devices: Look at the exponential growth of computing power, efficiency, and size, and then extrapolate. This way, you could easily predict the emergence of small computers which fit into your hands and with a bit of creativity, one could imagine that one day there would be tablets and smartphones. The trends were there, you just needed to imagine what could be done with computers which you can hold in your hand.</p>
<p>Similarly, Ray Kurzweil predicted the emergence of strong AI which is as intelligent or more intelligent than humans. For this prediction he also used data for the exponential growth of computing power and compared this to an estimate for the computational power of the brain.</p>
<p>He also acknowledges that the software will be as important as the hardware, and that the software development of strong AI will take longer because such software can only be developed once fast computer systems are available. This can be felt in the area of deep learning, where solid ideas of the 1990s were unfeasible due to the slow computers. Once graphic processing units (GPUs) were used, these computing limitations were quickly removed and rapid progress could be made.</p>
<p>However, Kurzweil also stresses that once the hardware level is reached, first “simple” strong AI systems will be developed quickly. He sets the date for brain-like computational power to 2020 and the emergence of strong AI (first human like intelligence or better) to 2030. Why these numbers? With persisting growth in computing power in 2019 we will reach the computing power which is equivalent to the human brain — or will we?</p>
<p>This estimate is based on two things: (1) The estimate for the complexity of the brain, (2) the estimate for the growth in computing power. As we will see, both these estimates are not up-to-date with current technology and knowledge about neuroscience and high performance computing.</p>
<p>Our knowledge of neuroscience doubles about every year. Using this doubling period, in the year of 2005 we would only have possessed about 0.098% of the neuroscience knowledge that we have today. This number is a bit off, because the doubling time was about 2 years in 2005 while it is less than a year now, but overall it is way below 1 %.</p>
<p>The thing is that Ray Kurzweil based his predictions on the neuroscience of 2005 and never updated them. An estimate for the brains computational power based on 1% of the neuroscience knowledge does not seem right. Here is small list of a few important discoveries made in the last two years which increase the computing power of the brain by many orders of magnitude:</p>
<ul>
<li>It was shown that brain connections rather than being passive cables, can themselves process information and alter the behavior of neurons in meaningful ways, e.g. brain connections help you to see the objects in everyday life. This fact alone increases brain computational complexity by several orders of magnitude</li>
<li>Neurons which do not fire still learn: There is much more going on than electrical spikes in neurons and brain connections: Proteins, which are the little biological machines which make everything in your body work, combined with local electric potential do a lot of information processing on their own — no activation of the neuron required</li>
<li>Neurons change their genome dynamically to produce the right proteins to handle everyday information processing tasks. Brain: “Oh you are reading a blog. Wait a second, I just upregulate this reading-gene to help you understand the content of the blog better.” (This is an exaggeration — but it is not too far off)</li>
</ul>
<p>Before we look at the complexity of the brain, let us first look at brain simulations. Brain simulations are often used to predict human-like intelligence. If we can simulate a human brain, then it will not be long until we are able to develop human-like intelligence, right? So the next paragraph looks at this reasoning. Can brain simulations really provide reliable evidence for predicting the emergence of artificial intelligence?</p>
<h3>The problems with brain simulations</h3>
<p>Brain simulations simulate the electrical signals which are emitted by neurons and the size of the connections between neurons. A brain simulation starts with random signals and the whole system stabilizes according to rules which are thought to govern information processing steps in the brain. After running these rules for some time, stable signals may form which can be compared to the signals of the brain. If the signals of the simulation are similar to recordings of the brain, this increases our confidence that our chosen rules are somewhat similar to the rules that the brain uses. Thus we can validate large scale information processing rules in the brain. However, the big problem with brain simulations is, that this is pretty much all we can do.</p>
<p>We do not gain any understanding what these signals mean or what function they could possess. We cannot test any meaningful hypotheses with this brain model other than the vague “our rules produce similar activity”. The lack of precise hypotheses which make accurate predictions (“If the activity is like this, then the circuit detected an apple instead of an orange”) is one of the loudest <a href="https://www.nature.com/news/neuroscience-where-is-the-brain-in-the-human-brain-project-1.15803">criticism of the European brain simulation project</a>. The brain project is regarded as rather useless by many neuroscientists and even dangerous, because it sucks away money for useful neuroscience projects which actually shed light on neural information processing.</p>
<p>Another problem is that these brain simulations rely on models which are outdated, incomplete and which dismiss many biological parts in neurological information processing. This is mainly so, because the electrical information processing in the brain is much better understood. Another more conveniently reason is, that current models are already able to reproduce the needed output patterns (which is the main goal after all) and so there is no need to update these models to be more brain-like.</p>
<p>So to summarize, the problems with brain simulations are:</p>
<ul>
<li>Not possible to test specific scientific hypotheses (compare this to the large hadron collider project with its perfectly defined hypotheses)</li>
<li>Does not simulate real brain processing (no firing connections, no biological interactions)</li>
<li>Does not give any insight into the functionality of brain processing (the meaning of the simulated activity is not assessed)</li>
</ul>
<p>The last point is the most important argument against the usefulness of brain processing for strong-AI estimation. If we could develop a brain simulation of the visual system, which would do well on say, the MNIST and ImageNet data sets, this would be useful to estimate progress in brain-like AI. But without this, or any similar observable function, brain simulations remain rather useless with respect to AI.</p>
<p>With this said, brain simulations are still valuable to test hypothesized general rules of information processing in the brain —we have nothing better for this — but they are quite useless to make sense of what the information processing in the brain means, and thus constitute unreliable evidence for predicting the progress in AI. Anything that relies on brain simulation as evidence for predictions of future strong-AI should be looked at with great skepticism.</p>
<h3>Estimating the brains computational complexity</h3>
<p>As mentioned in the introduction, the estimates of the brain&#8217;s complexity are a decade old and many new discoveries made this old estimate obsolete. I never came across an estimate which is up to date, so here I derive my own estimate. While doing this, I will focus mostly on the electrochemical information processing and neglect the biological interactions within the neuron, because they are too complex (and this blog post is already very long). Therefore the estimate that is derived here can be thought of as a lower bound of complexity — it should always be assumed that the brain is more complex than this.</p>
<p>During the construction of this model of complexity, I will also relate every step in the model with its deep learning equivalents. This will give you a better understanding of how close deep learning is related to and how fast deep learning really is compared to the human brain</p>
<h3>Defining reference numbers for the model</h3>
<p>We know some facts and estimates which help us to start with our model building:</p>
<ul>
<li>The brain uses learning algorithms which are very different from deep learning, but the architecture of neurons is similar to convolutional nets</li>
<li>The adult brain has 86 billion neurons, about 10 trillion synapse, and about 300 billion dendrites (tree-like structures with synapses on them)</li>
<li>The brain of a child has far more than 100 billion neurons, and has synapses and dendrites in excess of 15 trillion and 150 billion, respectively</li>
<li>The brain of a fetus has more than a trillion neurons; neurons which are misplaced die quickly (this is also the reason why adults have fewer neurons than children)</li>
</ul>
<figure id="attachment_313" aria-describedby="caption-attachment-313" style="width: 150px" class="wp-caption alignleft"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebellum_animation_small.gif?ssl=1"><img data-attachment-id="313" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/cerebellum_animation_small/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebellum_animation_small.gif?fit=150%2C150&amp;ssl=1" data-orig-size="150,150" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Cerebellum_animation_small" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebellum_animation_small.gif?fit=150%2C150&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebellum_animation_small.gif?fit=150%2C150&amp;ssl=1" class="wp-image-313 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebellum_animation_small.gif?resize=150%2C150&#038;ssl=1" alt="Cerebellum_animation_small" width="150" height="150" data-recalc-dims="1" /></a><figcaption id="caption-attachment-313" class="wp-caption-text">Location of the cerebellum which contains roughly 3/4 of all neurons and connections. Image source: <a href="https://commons.wikimedia.org/wiki/File:Cerebellum_animation_small.gif">1</a></figcaption></figure>
<figure id="attachment_314" aria-describedby="caption-attachment-314" style="width: 150px" class="wp-caption alignleft"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebrum_animation_small.gif?ssl=1"><img data-attachment-id="314" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/cerebrum_animation_small/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebrum_animation_small.gif?fit=150%2C150&amp;ssl=1" data-orig-size="150,150" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Cerebrum_animation_small" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebrum_animation_small.gif?fit=150%2C150&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebrum_animation_small.gif?fit=150%2C150&amp;ssl=1" class="wp-image-314 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/cerebrum_animation_small.gif?resize=150%2C150&#038;ssl=1" alt="Cerebrum_animation_small" width="150" height="150" data-recalc-dims="1" /></a><figcaption id="caption-attachment-314" class="wp-caption-text">Location of the cerebrum; also referred to as &#8220;the cortex&#8221;. More precisely, the cortex is the outer layer of the brain, which contains most neurons of the cerebrum. Image source: <a href="https://commons.wikimedia.org/wiki/File:Cerebrum_animation_small.gif">1</a></figcaption></figure>
<ul>
<li>The cerebellum, the super computer of the brain, contains roughly ¾ of all neurons (this ratio is consistent in most mammal species)</li>
<li>The cerebrum, the main driver of “intelligence”, contains roughly ¼ of all neurons</li>
<li>An average neuron in the cerebellum has about 25000 synapses</li>
<li>An average neuron in the cerebrum has about 5000-15000 synapses</li>
</ul>
<p>The number of neurons is well known; the number of synapses and dendrites is only known within a certain boundary and I chose conservative estimates here.</p>
<p>The average synapses per neuron differ wildly between neurons, and the number here is a rough average. It is known that most synapses in the cerebellum are made between dendrites of Purkinje neurons and two different types of neurons that make connections that “climb up” or “cross parallel” with the Purkinje’s synapses. It is known that Purkinje cells have about 100000 synapses each. Because these cells have by far the largest weight in the cerebellum, one can estimate the complexity of the brain best if one looks at these neurons and at the interactions that they make.</p>
<figure id="attachment_316" aria-describedby="caption-attachment-316" style="width: 500px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_types.gif?ssl=1"><img data-attachment-id="316" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/neuron_types/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_types.gif?fit=500%2C302&amp;ssl=1" data-orig-size="500,302" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="neuron_types" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_types.gif?fit=300%2C181&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_types.gif?fit=500%2C302&amp;ssl=1" class="wp-image-316 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_types.gif?resize=500%2C302&#038;ssl=1" alt="neuron_types" width="500" height="302" data-recalc-dims="1" /></a><figcaption id="caption-attachment-316" class="wp-caption-text">There are many hundreds of different types of neurons; here some of the more common neurons. Thanks to Robert Stufflebeam for this image (<a href="http://www.mind.ilstu.edu/curriculum/neurons_intro/neurons_intro.php">source</a>).</figcaption></figure>
<p>It is important to differentiate between the complexity of a brain region and its functional importance. While almost all computation is carried out by the cerebellum, almost all important functions are carried out by the cerebrum (or cortex). The cortex uses the cerebellum to generate predictions, corrections and conclusions, but the cortex accumulates these insights and acts upon them.</p>
<p>For the cerebrum it is known that neurons almost never have more than 50000 synapses, and unlike the cerebellum, most neurons have a number of synapses within the range of 5000-15000.</p>
<h3>How do we use these numbers?</h3>
<p>A common approach for estimating the computational complexity of the brain is to assume all information processing in the brain can be represented by the combination of impulses when a neuron fires (action potentials) and the size (mostly number of receptors) of the synapses that each neuron has. Thus one can multiply the estimates for the number of neurons and their synapses and add everything together. Then one multiplies this by the rate of fire for the average neurons which is about 200 action potentials per second. This model is what Ray Kurzweil uses to create his estimate. While this model was okay a few decades ago, it is not suitable to model the brain from a modern view point, as it leaves out much of the important neurological information processing which is so much more than mere firing neurons.</p>
<p>A model which approximates the behavior of neurons more accurately is the extended linear-nonlinear-Poisson cascade model (LNP). The extended LNP model is <a href="https://www.sciencedirect.com/science/article/pii/S0959438814000130">currently viewed as an accurate model of how neurons process information</a>. However, the extended LNP model still leaves out some fine details, which are deemed unimportant to model large scale brain function. Indeed adding these fine details to the model will add almost no additional computational complexity, but makes the model more complex to understand — thus including these details in simulations would violate the scientific method which seeks to find the simplest models for a given theory. However, this extended model is actually very similar to deep learning and thus I will include these details here.</p>
<p>There are other good models that are also suitable for this. The primary reason why I chose the LNP model is that it is very close to deep learning. This makes this model perfect to compare the architecture of a neuron to the architecture of a convolutional net. I will do this in the next section and at the same time I will derive an estimate for the complexity of the brain.</p>
<h2>Part II: The brain vs. deep learning — a comparative analysis</h2>
<p>Now I will explain step by step how the brain processes information. I will mention the steps of information processing which are well understood and which are supported by reliable evidence. On top of these steps, there are many intermediary steps at the biological level (proteins and genes) which are still poorly understood but known to be very important for information processing. I will not go into depth into these biological processes but provide a short outline, which might help the knowledge hungry readers to delve into these depths themselves. We now begin this journey from the neurotransmitters released from a firing neuron and walk along all its processes until we reach the point where the next neuron releases its neurotransmitters, so that we return to where we started.</p>
<p>The next section introduces a couple of new terms which are necessary to follow the rest of the blog post, so read it carefully if you are not familiar with basic neurobiology.</p>
<figure id="attachment_343" aria-describedby="caption-attachment-343" style="width: 1193px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_anatomy1.jpg?ssl=1"><img data-attachment-id="343" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/neuron_anatomy-2/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_anatomy1.jpg?fit=1193%2C685&amp;ssl=1" data-orig-size="1193,685" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="neuron_anatomy" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_anatomy1.jpg?fit=300%2C172&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_anatomy1.jpg?fit=1024%2C588&amp;ssl=1" class="wp-image-343 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/neuron_anatomy1.jpg?resize=1193%2C685&#038;ssl=1" alt="neuron_anatomy" width="1193" height="685" data-recalc-dims="1" /></a><figcaption id="caption-attachment-343" class="wp-caption-text">Image sources: <a href="https://commons.wikimedia.org/wiki/File:Neuron_Hand-tuned.svg">1</a>,<a href="https://commons.wikimedia.org/wiki/File:SynapseSchematic_lines.svg">2</a>,3,4</figcaption></figure>
<p>Neurons use the axon — a tube like structure— to transmit their electric signals over long stretches in the brain. When a neuron fires, it fires an action potential — an electrical signal— down its axon which branches into a tree of small endings, called axon terminals. On the ending of each of these axon terminals sit some proteins which convert this electrical message back into a chemical one: Small balls — called synaptic vesicles — filled with a couple of neurotransmitters each are released into an area outside of the neuron, called synaptic cleft. This area separates the axon terminal from the beginning of the next neuron (a synapse) and allows the neurotransmitter to move freely to pursue different tasks.</p>
<p>The synapses are most commonly located at a structure which looks very much like the roots of a tree or plant; this is the dendritic tree composed of dendrites which branch into larger arms (this represents the connections between neurons in a neural network), which finally reach the core of the cell, which is called soma. These dendrites hold almost all synapses which connect one neuron to the next and thus form the principal connections. A synapse may hold hundreds of receptors to which neurotransmitter can bind themselves.</p>
<p>You can imagine this compound of axon terminal and synapses at a dendrite as the (dense) input layer (of an image if you will) into a convolutional net. Each neuron may have less than 5 dendrites or as many as a few hundred thousand. Later we will see that the function of the dendritic tree is similar to the combination of a convolutional layer followed by max-pooling in a convolutional network.</p>
<p>Going back to the biological process, the synaptic vesicles merge with the surface of the axon terminal and turn themselves inside-out spilling their neurotransmitters into the synaptic cleft. There the neurotransmitters drift in a vibrating motion due to the temperature in the environment, until they (1) find a fitting lock (receptor protein) which fits their key (the neurotransmitter), (2) the neurotransmitters encounter a protein which disintegrates them, or (3) the neurotransmitters encounter a protein which pulls them back into the axon (reuptake) where they are reused. Antidepressants mostly work by (3) preventing, or (4) enhancing the reuptake of the neurotransmitter serotonin; (3) preventing reuptake will yield changes in information processing after some days or weeks, while (4) enhancing reuptake leads to changes within seconds or minutes. So neurotransmitter reuptake mechanisms are integral for minute to minute information processing. Reuptake is ignored in the LNP model.</p>
<p>However, the combination of the amount of neurotransmitters released, the number of synapses for a given neurotransmitter, and how many neurotransmitters actually make it into a fitting protein on the synapse can be thought of as the weight parameter in a densely (fully) connected layer of a neural network, or in other words, the total input to a neuron is the sum of all axon-terminal-neurotransmitter-synapse interactions. Mathematically, we can model this as the dot product between two matrices (A dot B; [amount of neurotransmitters of all inputs] dot [amount of fitting proteins on all synapses]).</p>
<p>After a neurotransmitter has locked onto a fitting protein on a synapse, it can do a lot of different things: Most commonly, neurotransmitters will just (1) open up channels, to let charged particles flow (through diffusion) into the dendrites, but it can also cause a rarer effect with huge consequences: The neurotransmitter (2) binds to a G-protein which then produces a protein signaling cascade which, (2a) activates (upregulates) a gene which is then used to produce a new protein which is integrated into either the surface of the neuron, its dendrites, and/or its synapses; which (2b) alerts existing proteins to do a certain function at a specific site (create or remove more synapses, unblock some entrances, attach new proteins to the surface of the synapse). This is ignored in the NLP model.</p>
<p>Once the channels are open, negatively or positively charged particles enter into the dendritic spine. A dendritic spine is a small mushroom-like structure on to which the synapse is attached. These dendritic spines can store electric potential and have their own dynamics of information processing. This is ignored in the NLP model.</p>
<figure id="attachment_337" aria-describedby="caption-attachment-337" style="width: 471px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spine.jpg?ssl=1"><img data-attachment-id="337" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/dendritic_spine/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spine.jpg?fit=471%2C335&amp;ssl=1" data-orig-size="471,335" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="dendritic_spine" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spine.jpg?fit=300%2C213&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spine.jpg?fit=471%2C335&amp;ssl=1" class="wp-image-337 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spine.jpg?resize=471%2C335&#038;ssl=1" alt="dendritic_spine" width="471" height="335" data-recalc-dims="1" /></a><figcaption id="caption-attachment-337" class="wp-caption-text">Dendritic spines have their own internals information processing dynamics which is largely determined by its shape and size. Image source: <a href="https://en.wikipedia.org/wiki/File:Spline_types_3D.png">1</a>,<a href="https://en.wikipedia.org/wiki/File:Dendritic_spines.jpg">2</a></figcaption></figure>
<p>The charge of the particles that may enter the dendritic spine are either negatively or positively charged — some neurotransmitters only open channels for negative particles, others only for positive ones. There are also channels which let positively charged particles leave the neuron, thus increasing the negativity of the electric potential (a neuron “fires” if it becomes too positive). The size and shape of the mushroom-like dendritic spine corresponds to its behavior. This is ignored in the NLP model.</p>
<p>Once particles entered the spine, there are many things they can affect. Most commonly, they will (1) just travel along the dendrites to the cell body in the neuron and then, if the cell gets too positively charged (depolarization) they induce an action potential (the neuron “fires”). But other actions are also common:  The charged particles accumulate in the dendritic spine directly and (2) open up voltage-gated channels which may polarize the cell further (this is an example of the dendritic spine information processing mentioned above). Another very important process are (3) dendritic spikes.</p>
<h3>Dendritic spikes</h3>
<p>Dendritic spikes are a phenomenon which has been known to exist for some years, but only in 2013 the techniques were advanced enough to collect the data to show that these spikes were important for information processing. To measure dendritic spikes, you have to attach some very tiny clamps onto dendrites with the help of a computer which moves the clamp with great precision. To have some sort of idea where your clamp is, you need a special microscope to observe the clamp as you progress onto a dendrite. Even then you mostly attach the clamp in a rather blind matter because at such tiny scale every movement made is a rather giant leap. Only a few teams in the world have the equipment and skill to attach such clamps onto dendrites.</p>
<p>However, the direct data gathered by those few teams was enough to establish dendritic spikes as important information processing events. Due to the introduction of dendritic spikes into computational models of neurons, the complexity of a single neuron has become very similar to a convolutional net with two convolutional layers. As we see later the LNP model also uses non-linearities very similar to a rectified linear function, and also makes use of a spike generator which is very similar to dropout – so a neuron is very much like an entire convolutional net. But more about that later and back to dendritic spikes and what exactly they are.</p>
<p>Dendritic spikes occur when a critical level of depolarization is reached in a dendrite. The depolarization discharges as an electric potential along the walls of the dendrite and may trigger voltage-gated channels along its way through the dendritic tree and eventually, if strong enough, the electric potential reaches the core of the neuron where it may trigger a true action potential. If the dendritic spike fails to trigger an action potential, the opened voltage-gated channels in neighboring dendrites may do exactly that a split second later. Due to channels opened from the dendritic spike more charged particles enter the neuron, which then may either trigger (common) or stifle (rare) a full action potential at the neurons cell body (soma).</p>
<figure id="attachment_339" aria-describedby="caption-attachment-339" style="width: 677px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spikes.png?ssl=1"><img data-attachment-id="339" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/dendritic_spikes/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spikes.png?fit=677%2C263&amp;ssl=1" data-orig-size="677,263" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="dendritic_spikes" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spikes.png?fit=300%2C117&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spikes.png?fit=677%2C263&amp;ssl=1" class="wp-image-339 size-full" title="background-color: #fff" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/dendritic_spikes.png?resize=677%2C263&#038;ssl=1" alt="dendritic_spikes" width="677" height="263" data-recalc-dims="1" /></a><figcaption id="caption-attachment-339" class="wp-caption-text">A shows a computer model of a neuron that does not model dendritic spikes; B models simple dynamics of dendritic spikes; C models more complex dynamics of dendritic spikes which takes into account the one dimensional diffusion of particles (which is similar to a convolution operation). Take note that these images are only snapshots in a particular moment of time. A big thanks to <a href="https://groups.oist.jp/onu">Berd Kuhn</a>. Image copyright © 2014 Anwar, Roome, Nedelescu, Chen, Kuhn and De Schutter as published in <em><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4107854/">Frontiers in Cellular Neuroscience</a> <a href="#anwar14">(Anwar et al. 2014)</a></em></figcaption></figure>
<p>This process is very similar to max-pooling, where a single large activation “overwrites” other neighboring values. However, after a dendritic spike, neighboring values are not overwritten like during max-pooling used in deep learning, but the opening of voltage-gated channels greatly amplifies the signals in all neighboring branches within the dendritic tree. Thus a dendritic spike may heighten the electrochemical levels in neighboring dendrites to a level which is more similar to the maximum input — this effect is close to max-pooling.</p>
<p>Indeed it was shown that dendritic spikes in the visual system serve the same purpose as max pooling in convolutional nets for object recognition: In deep learning, max-pooling is used to achieve (limited) rotation, translation, and scale invariance (meaning that our algorithm can detect an object in an image where the object is rotated, moved, or shrunk/enlarged by a few pixels). One can think of this process as setting all surrounding pixels to the same large activation and make each activation share the weight to the next layer (in software the values are discarded for computational efficiency — this is mathematically equivalent). Similarly, it was shown that dendritic spikes in the visual system are sensitive to the orientation of an object. So dendritic spikes do not only have computational similarity, but also similarities in function.</p>
<p>The analogy does not end here. During neural back-propagation — that is when the action potential travels from the cell body back into the dendritic tree — the signal cannot backpropagate into the dendritic branch where the dendritic spike originated because these are “deactivated” due to the recent electrical activity. Thus a clear learning signal is sent to inactivated branches. At first this may seem like the exact opposite from the backpropagation used for max-pooling, where everything but the max-pooling activation is backpropagated. However, the absence of a backpropagation signal in a dendrite is a rare event and represents a learning signal on its own. Thus, dendrites which produce dendritic spikes have special learning signals just like activated units in max-pooling.</p>
<p>To better understand what dendritic spikes are and what they look like, I very much want to encourage you to watch <a href="https://www.hhmi.org/research/how-do-neurons-compute-output-their-inputs">this video</a> (for which I do not have the copyright). The video shows how two dendritic spikes lead to an action potential.</p>
<p>This combination of dendritic spikes and action potentials and the structure of the dendritic tree has been found to be critical for learning and memory in the hippocampus, the main brain region responsible for forming new memories and writing them to our “hard drive” at night.</p>
<p>Dendritic spikes are one of the main drivers of computational complexity which have been left out from past models of the complexity of the brain. Also, these new findings show that neural back-propagation does not have to be neuron-to-neuron in order to learn complex functions; a single neuron already implements a convolutional net and thus has enough computational complexity to model complex phenomena. As such, there is little need for learning rules that span multiple neurons — a single neuron can produce the same outputs we create with our convolutional nets today.</p>
<p>But these findings about dendritic spikes are not the only advance made in our understanding of the information processing steps during this stage of the neural information processing pathway. Genetic manipulation and targeted protein synthesis are sources that increase computational complexity by orders of magnitude, and only recently we made advances which reveal the true extend of biological information processing.</p>
<h3>Protein signaling cascades</h3>
<p>As I said in the introduction of this part, I will not cover the parts of biological information processing extensively, but I want to give you enough information so that you can start learning more from here.</p>
<p>One thing one has to understand is that a cell looks much different from how it is displayed in text books. Cells crawl with proteins: There are about 10 billion proteins in any given human cell and these proteins are not idle: They combine with other proteins, work on a task, or jitter around to find new tasks to work on.</p>
<p>All the functions described above are the work of proteins. For example the key-and-lock mechanism and the channels that play the gatekeeper for the charged particles that leave and enter the neuron are all proteins. The proteins I mean in this paragraph are not these common proteins, but proteins with special biological functions.</p>
<p>As an example the abundant neurotransmitter glutamate may bind to a NDMA receptor which then opens up its channels for many different kinds of charged particles and after being opened, the channel only closes when the neuron fires. The strength of synapses is highly dependent on this process, where the synapse is adjusted according to the location of the NDMA receptor and the timing of signals which are backpropagated to the synapses. We know this process is critical to learning in the brain, but it is only a small piece in a large puzzle.</p>
<p>The charged particles which may enter the neuron may additionally induce protein signaling cascades own their own. For example the cascade below shows how an activated NMDA receptor (green) lets charged calcium CA2+ inside which triggers a cascade which eventually leads to AMPAR receptors (violet) being trafficked and installed on the synapse.</p>
<figure id="attachment_321" aria-describedby="caption-attachment-321" style="width: 767px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/regulationofampartrafficking.jpg?ssl=1"><img data-attachment-id="321" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/regulationofampartrafficking/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/regulationofampartrafficking.jpg?fit=767%2C599&amp;ssl=1" data-orig-size="767,599" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="RegulationOfAMPARTrafficking" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/regulationofampartrafficking.jpg?fit=300%2C234&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/regulationofampartrafficking.jpg?fit=767%2C599&amp;ssl=1" class="wp-image-321 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/regulationofampartrafficking.jpg?resize=767%2C599&#038;ssl=1" alt="RegulationOfAMPARTrafficking" width="767" height="599" data-recalc-dims="1" /></a><figcaption id="caption-attachment-321" class="wp-caption-text">Image source: <a href="https://commons.wikimedia.org/wiki/File:RegulationOfAMPARTrafficking.jpg">1</a></figcaption></figure>
<p>It was shown again and again that these special proteins have a great influence on the information processing in neurons, but it is difficult to pick out a specific type of protein from this seemingly chaotic soup of 10 billion proteins and study its precise function. Findings are often complex with a chain of reactions involving many different proteins until a desired end-product or end-function is reached. Often the start and end functions are known but not the exact path which led from one to the other. Sophisticated technology helped greatly to study proteins in detail, and as technology gets better and better we will further our understanding of biological information processing in neurons.</p>
<h3>Genetic manipulation</h3>
<p>The complexity of biological information processing does not end with protein signaling cascades, the 10 billion proteins are not a random soup of workers that do their tasks, but these workers are designed in specific quantities to serve specific functions that are relevant at the moment. All this is controlled by a tight feedback loop involving helper proteins, DNA, and messenger RNA (mRNA).</p>
<p>If we use programming metaphors to describe this whole process, then the DNA represents the whole github website with all its public packages, and messenger RNA is a big library which features many other smaller libraries with different functions (something like the C++ boost library).</p>
<p>It all begins with a programming problem you want to solve (a biological problem is detected). You use google and stackoverflow to find recommendations for libraries which you can use to solve the problem and soon you find a post that suggests that you use library X to solve problem Y (problem Y is detected on a local level in a cell with known solution of protein X; the protein that detected this defect then cascades into a chain of protein signals which leads to the upregulation of the gene G which can produce protein X; here upregulation is a &#8220;Hey! Produce more of this, please!&#8221; signal to the nucleus of the cell where the DNA lies). You download the library and compile it (the gene G is copied (transcribed) as a short string of mRNA from the very long string of DNA). You then do configure the install (the mRNA leaves the core) with the respective configuration (the mRNA is translated into a protein, the protein may be adjusted by other proteins after this), and install the library in a global “/lib” directory (the protein folds itself into its correct form after which it is fully functional). After you have installed the library, you import the needed part of the library to your program (the folded protein travels (randomly) to the site where it is needed) and you use certain functions of this library to solve your problem (the protein does some kind of work to solve the problem).</p>
<p>Additional to this, neurons may also dynamically alter their genome, that is they can dynamically change their github repository to add or remove libraries.</p>
<p>To understand this process further, you may want to watch the following video, which shows how HIV produces its proteins and how the virus can change the host DNA to suit its needs. The process described in this video animation is very similar to what is going on in neurons. To make it more similar to the process in neurons, imagine that HIV is a neurotransmitter and that everything contained in the HIV cell is in the neuron in the first place. What you have then is an accurate representation of how neurons make use of theirs genes and proteins:</p>
<p><iframe class="youtube-player" width="640" height="360" src="https://www.youtube.com/embed/RO8MP3wMvqg?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;start=59&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation"></iframe></p>
<p>You may ask, isn’t it so that every cell in your body has (almost) the same DNA in order to be able to replicate itself? Generally, this is true for most cells, but not true for most neurons. Neurons will typically have a genome that is different from the original genome that you were assigned to at birth. Neurons may have additional or fewer chromosomes and have sequences of information removed or added from certain chromosomes.</p>
<p>It was shown, that this behavior is important for information processing and if gone awry, this may contribute to brain disorders like depression or Alzheimer’s disease. Recently it was also shown, that neurons change their genome on a daily basis to improve information processing demands.</p>
<p>So when you sit at your desk for five days, and then on the weekend decide to go on a hike, it makes good sense that the brain adapts its neurons for this new task, because entirely different information processing is needed after this change of environment.</p>
<p>Equally, in an evolutionary sense, it would be beneficial to have different “modes” for hunting/gathering and social activity within the village — and it seems that this function might be for something like this. In general, the biological information processing apparatus is extremely efficient in responding to slower information processing demands that range from minutes to hours.</p>
<p>With respect to deep learning, an equivalent function would be to alter the function of a trained convolutional net in significant but rule-based ways; for example to apply a transformation to all parameters when changing from one to another task (recognition of street numbers -&gt; transform parameters -&gt; recognition of pedestrians).</p>
<p>Nothing of this biological information processing is modeled by the LNP model.</p>
<p>Looking back at all this, it seems rather strange that so many researchers think they that they can replicate the brain&#8217;s behavior by concentrating on the electrochemical properties and inter-neuron interactions only. Imagine that every unit in a convolutional network has its own github, from which it <em>learns</em> to dynamically download, compile and use the best libraries to solve a certain task. From all this you can see that a single neuron is probably more complex than an entire convolutional net, but we continue from here in our focus on electrochemical processes and see where it leads us.</p>
<h3>Back to the LNP model</h3>
<p>After all this above, there is only one more relevant step in information processing for our model. Once a critical level of depolarization is reached, a neuron will most often fire, but not always. There are mechanisms that prevent a neuron from firing. For example shortly after a neuron fired, its electric potential is too positive to produce a fully-fledged action potential, and thus it cannot fire again. This blockage may be present even when a sufficient electric potential is reached, because this blockade is a biological function and not a physical switch.</p>
<p>In the LNP model, this blockage of an action potential is modeled as an inhomogeneous Poisson process which has a Poisson distribution. A Poisson process with a Poisson distribution as a model means that the neuron has a very high probability to fire the first or second time it reached its threshold potential, but it may also be (with a exponentially decreasing probability) that a neuron may not fire for many more times.</p>
<figure id="attachment_325" aria-describedby="caption-attachment-325" style="width: 652px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/poisson.png?ssl=1"><img data-attachment-id="325" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/poisson/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/poisson.png?fit=652%2C347&amp;ssl=1" data-orig-size="652,347" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Poisson" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/poisson.png?fit=300%2C160&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/poisson.png?fit=652%2C347&amp;ssl=1" class="wp-image-325 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/poisson.png?resize=652%2C347&#038;ssl=1" alt="Poisson" width="652" height="347" data-recalc-dims="1" /></a><figcaption id="caption-attachment-325" class="wp-caption-text">A Poisson(0.5) distribution with a randomly drawn sample. Here 0,1,2,3 represents the waiting time until the neuron fires, thus 0 means it fires without delay, while 2 means it will not fire for two cycles even if it could fire physically.</figcaption></figure>
<p>There are exceptions to this rule, where neurons disable this mechanism and fire continuously at the rates which are governed by the physics alone — but these are special events which I will ignore at this point. Generally, this whole process is very similar to dropout used in deep learning which uses a uniform distribution instead of a Poisson distribution; thus this process can be viewed as some kind of regularization method that the brain uses instead of dropout.</p>
<p>In the next step, if the neuron fires, it releases an action potential. The action potential has very little difference in its amplitude, meaning the electric potential generated by the neuron almost always has the same magnitude, and thus is a reliable signal. As this signal travels down the axon it gets weaker and weaker. When it flows into the branches of the axon terminal, its final strength will be dependent on the shape and length of these branches; so each axon terminal will receive a different amount of electrical potential. This spatial information, together with the temporal information due to the spiking pattern of action potentials, is then translated into electrochemical information (it was shown that they are translated into spikes of neurotransmitters themselves that last about 2ms). To adjust the output signal, the axon terminal can move, grow or shrink (spatial), or it may alter its protein makeup which is responsible for releasing the synaptic vesicles (temporal).</p>
<p>Now we are back at the beginning: Neurotransmitters are released from the axon terminal (which can be modeled as a dense matrix multiplication) and the steps repeat themselves.</p>
<h3>Learning and memory in the brain</h3>
<p>Now that we went through the whole process back to back, let us put all this into context to see how the brain uses all this in concert.</p>
<p>Most neurons repeat the process of receive-inputs-and-fire about 50 to 1000 times per second; the firing frequency is highly dependent on the type of neuron and if a neuron is actively processesing tasks. Even if a neuron does not process a task it will fire continuously in a random fashion.  Once some meaningful information is processed, this random firing activity makes way for a highly synchronized activity between neighboring neurons in a brain region. This synchronized activity is poorly understood, but is thought to be integral to understanding information processing in the brain and how it learns.</p>
<p>Currently, it is not precisely known how the brain learns. We do know that it adjusts synapses with some sort of reinforcement learning algorithm in order to learn new memories, but the precise details are unclear and the weak and contradicting evidence indicates that we are missing some important pieces of the puzzle. We got the big picture right, but we cannot figure out the brain&#8217;s learning algorithm without the fine detail which we are still lacking.</p>
<p>Concerning memories, we know that some memories are directly stored in the hippocampus, the main learning region of the brain (if you lose your hippocampus in each brain hemisphere, you cannot form new memories). However, most long-term memories are created and integrated with other memories during your REM sleep phase, when so called sleep spindles unwind the information of your hippocampus to all other brain areas. Long-term memories are generally all local: Your visual memories are stored in the visual system; your memories for your tongue (taste, texture) are stored in the brain region responsible for your tongue, etcetera.</p>
<p>It is also known, that the hippocampus acts as a memory buffer. Once it is full, you need to sleep to empty its contents to the rest of your brain (through sleep spindles during REM sleep); this might be why babies sleep so much and so irregularly —once their learning buffer is full, they sleep to quickly clear their buffer in order to learn more after they wake. You can still learn when this memory buffer is full, but retention is much worse and new memories might wrangle with other memories in the buffer for space and displace them —so really get your needed amount of sleep. Sleeping less and irregularly is unproductive, especially for students who need to learn.</p>
<figure id="attachment_341" aria-describedby="caption-attachment-341" style="width: 200px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hippocampus_small.gif?ssl=1"><img data-attachment-id="341" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/hippocampus_small/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hippocampus_small.gif?fit=200%2C200&amp;ssl=1" data-orig-size="200,200" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Hippocampus_small" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hippocampus_small.gif?fit=200%2C200&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hippocampus_small.gif?fit=200%2C200&amp;ssl=1" class="wp-image-341 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hippocampus_small.gif?resize=200%2C200&#038;ssl=1" alt="Hippocampus_small" width="200" height="200" data-recalc-dims="1" /></a><figcaption id="caption-attachment-341" class="wp-caption-text">The hippocampus in each hemisphere is shown in red. Image source: <a href="https://commons.wikimedia.org/wiki/File:Hippocampus_small.gif">1</a></figcaption></figure>
<p>Because memories are integrated with other memories during your “write buffer to hard-drive” stage, sleep is also very important for creativity. The next time you recall a certain memory after you slept, it might be altered with some new information that your brain thought to be fitting to attach to that memory.</p>
<p>I think we all had this: We wake up with some crazy new idea, only to see that it was quite nonsensical in the first place — so our brain is not perfect either and makes mistakes. But other times it just works: One time I tortured myself with a math problem for 7 hours non-stop, only to go to bed disappointed with only about a quarter of the whole problem solved. After I woke, I immediately had two new ideas how to solve the problem: The first did not work; but second made things very easy and I could sketch a solution to the math problem within 15 minutes — an ode to sleep!</p>
<p>Now why do I talk about memories when this blog post is about computation? The thing is that memory creation — or in other words — a method to store computed results for a long time, is critical for any intelligence. In brain simulations, one is satisfied if the synapse and activations occur in the same distribution as they do in the real brain, but one does not care if these synapses or activations correspond to anything meaningful — like memories or “distributed representations” needed for functions such as object recognition. This is a great flaw. Brain simulations have no memories.</p>
<p>In brain simulation, the diffusion of electrochemical particles is modeled by differential equations. These differential equations are complex, but can be modeled with simple techniques like Euler’s method to approximate these complex differential equations. The result has poor accuracy (meaning high error) but the algorithm is very computationally efficient and the accuracy is sufficient to reproduce the activities of real neurons along with their size and distribution of synapses. The great disadvantage is that we generally cannot learn parameters from a method like this — we cannot create meaningful memories.</p>
<p>However, as I have shown in <a href="https://timdettmers.com/2015/03/26/convolution-deep-learning/">my blog post about convolution</a>, we can also model diffusion by applying convolution — a very computationally complex operation. The advantage about convolution is that we can use methods like maximum-likelihood estimation with backpropagation to learn parameters which lead to meaningful representations which are akin to memories (just like we do in convolutional nets). This is exactly akin to the LNP model with its convolution operation.</p>
<p>So besides its great similarity to deep learning models, the LNP model is also justified in that it is actually possible to learn parameters which yield meaningful memories (where with memories I mean here distributed representations like those we find in deep learning algorithms).</p>
<p>This then also justifies the next point where I estimate the brain&#8217;s complexity by using convolution instead of Euler’s method on differential equations.</p>
<p>Another point to take away from for our model is, that we currently have no complexity assigned for the creation of memories (we only modeled the forward pass, not the backward pass with backpropagation). As such, we underestimate the complexity of the brain, but because we do not know how the brain learns, we cannot make any accurate estimates for the computational complexity of learning. With that said and kept in the back of our mind, let us move on to bringing the whole model together for a lower bound of computational complexity.</p>
<h3>Bringing it all together for a mathematical estimation of complexity</h3>
<p><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_complexity.png?ssl=1"><img data-attachment-id="333" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/brain_complexity/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_complexity.png?fit=780%2C278&amp;ssl=1" data-orig-size="780,278" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="brain_complexity" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_complexity.png?fit=300%2C107&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_complexity.png?fit=780%2C278&amp;ssl=1" class="aligncenter wp-image-333 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_complexity.png?resize=780%2C278&#038;ssl=1" alt="brain_complexity" width="780" height="278" data-recalc-dims="1" /></a></p>
<p>The next part is a bit tricky: We need to estimate the numbers for N, M, n and m and these differ widely among neurons.</p>
<p>We know that 50 of the 86 billion neurons in the brain are cerebellar granule neurons, so these neurons and their connection will be quite important in our estimation.</p>
<p>Cerebellar granule neurons are very tiny neurons with about 4 dendrites. Their main input is from the cortex. They integrate these signals and then send them along a T-shaped axon which feeds into the dendrites of Purkinje neurons.</p>
<p>Purkinje neurons are by far the most complex neurons, but there are only about 100 million of them. They may have more than a 100000 synapses each and about 1000 dendrites. Multiple Purkinje neurons bundle their outputs in about a dozen deep nuclei (a bunch of densely packed neurons) which then send signals back to the cortex.</p>
<p>This process is very crucial for non-verbal intelligence, abstract thinking and abstract creativity (creativity: Name as many words beginning with the letter A; abstract creativity: What if gravity bends space-time (general relativity)? What if these birds belonged to the same species when they came to this island (evolution)?). It was thought a few decades ago that the cerebellum only computes outputs for movement; for example while Einstein’s cerebrum was handled and studied carefully, his cerebellum was basically just cut off and put away, because it was regarded as a “primitive” brain part.</p>
<p>But since then it was shown that the cerebellum forms 1:1 connections with most brain regions of the cortex. Indeed, changes in the front part of the cerebellum during the ages 23 to 25 may change your non-verbal IQ by up to 30 points, and changes of 10-15 IQ points are common. This is very useful in most instances, whereas we lose neurons which perform a function which we do not need in everyday lives (calculus, or the foreign language which you learned but never used).</p>
<p>So it is crucial to get the estimation of the cerebellum right not only because it contains most neurons, but also because it is important for intelligence and information processing in general.</p>
<h3>Estimation of cerebellar filter dimensions</h3>
<p>Now if we look at a single dendrite, it branches off into a few branches and thus has a tree like structure. Along its total length it is usually packed with synapses. Dendritic spikes can originate in any branch of a dendrite (spatial dimension). When we take 3 branches per dendrite, and 4 dendrites in total we have a convolutional filter of size 3 and 4 for cerebellar granule neurons. Since linear convolution over two dimensions is the same as convolution over one dimension followed by convolution over the other dimension, we can also model this as a single 3&#215;4 convolution operation. Also note that this is mathematically identical to a model that describes the diffusion of particles originating from different sources (feature map) which diffuse according to a rule in their neighborhood (kernel) — this is exactly what happens at a physical level. More on this view in <a href="https://timdettmers.com/2015/03/26/convolution-deep-learning/">my blog post about convolution</a>.</p>
<p>Here I have chosen to represent the spatial domain with a single dimension. It was shown that the shape of the dendritic tree is also important in the resulting information processing and thus we would need two dimensions for the spatial domain. However, data is lacking to represent this mathematically in a meaningful way and thus I proceed with the simplification to one spatial dimension.</p>
<p>The temporal dimension is also important here: Charged particles may linger for a while until they are pumped out of the neuron. It is difficult to estimate a meaningful time frame, because the brain uses continuous time while our deep learning algorithms only know discrete time steps.</p>
<p>No single estimate makes sense from a biological perspective, but from a psychological perspective we know that the brain can take up unconscious information that is presented in an image in about 20 milliseconds (this involves only some fast, special parts of the brain). For conscious recognition of an object we need more time — at least 65 milliseconds, and on average about 80-200 milliseconds for reliable conscious recognition. This involves all the usual parts that are active for object recognition.</p>
<p>From these estimates, one can think about this process as “building up the information of the seen image over time within a neuron”. However, a neuron can only process information if it can differentiate meaningful information from random information (remember, neurons fire randomly if they do not actively process information). Once a certain level of “meaningful information” is present, the neuron actively reacts to that information. So in a certain sense information processing can be thought of as an epidemic of useful information that spreads across the brain: Information can only spread to one neuron, if the neighboring neuron is already infected with this information. Thinking in this way, such an epidemic of information infects all neurons in the brain within 80-200 milliseconds.</p>
<p>As such we can say that, while the object lacks details in the first 20 milliseconds, there is full detail at about 80-200 milliseconds. If we translate this into discrete images at the rate of 30 frames per second (normal video playback) —or in other words time steps — then 20 milliseconds would be 0.6 time steps, and 80-200 milliseconds 2.4-6 time steps. This means, that all the visual information that a neuron needs for its processing will be present in the neuron within 2.4 to 6 frames.</p>
<p>To make calculations easier, I here now choose a fixed time dimension of 5 time steps for neural processes. This means for the dendrites we have spatio-temporal convolutional filters of size 3x4x5 for cerebellar granule neurons. For Purkinje neurons a similar estimate would be filters of a size of about 10x1000x5. The non-linearity then reduces these inputs to a single number for each dendrite. This number represents an instantaneous firing rate, that is, the number represents how often the neuron fires in the respective interval of time, for example at 5 Hz, 100 Hz, 0 Hz etcetera. If the potential is too negative, no spike will result (0 HZ); if the potential is positive enough, then the magnitude of the spike is often proportional to the magnitude of the electric potential —but not always.</p>
<p>It was shown that dendritic summation of this firing rate can be linear (the sum), sub-linear (less than the sum), supra-linear (more than the sum) or bistable (less than the sum, or more than the sum, depending on the respective input); these behaviors of summation often differ from neuron to neuron. It is known that Purkinje neurons use linear summation, and thus their summation to form a spike rate is very similar to the rectified linear function max(0,x) which is commonly used in deep learning. Non-linear sums can be thought of different activation functions. It is important to add, that the activation function is determined by the type of the neuron.</p>
<p>The filters in the soma (or cell body) can be thought of as an additional temporal convolutional filter with a size of 1 in the spatial domain. So this is a filter that reduces the input to a single dimension with a time dimension of 5, that is, a 1x1x5 convolutional filter (this will be the same for all neurons).</p>
<p>Again, the non-linearity then reduces this to an instantaneous firing rate, which then is dropped out by a Poisson process, which is then fed into a weight-matrix.</p>
<p>At this point I want to again emphasize, that it is <u>not</u> correct to view the output of a neuron as binary; the information conveyed by a firing neuron is more like an if-then-else branch: “if(fire == True and dropout == False){ release_ neurotransmitters(); }else{ sleep(0.02); }”</p>
<p>The neurotransmitters are the true output of a neuron, but this is often confused. The source of this confusion is that it is very difficult to study neurotransmitter release and its dynamics with a synapse, while it is ridiculously easy to study action potentials. Most models of neurons thus model the output as action potentials because we have a lot of reliable data here; we do not have such data for neurotransmitter interactions at a real-time level. This is why action potentials are often confused as the true outputs of neurons when they are not.</p>
<p>When a neuron fires, this impulse can be thought of as being converted to a discrete number at the axon terminal (number of vesicles which are released) and is multiplied by another discrete number which represents the amount of receptors on the synapse (this whole process corresponds to a dense or fully connected weight in convolutional nets). In the next step of information processing, charged particles flow into the neuron and build up a real-valued electric potential. This has also some similarities to batch-normalization, because values are normalized into the range [0,threshold] (neuron: relative to the initial potential of the neuron; convolutional net: relative to the mean of activations in batch-normalization). When we look at this whole process, we can model it as a matrix multiplication between two real-valued matrices (doing a scaled normalization before or after this is mathematically equivalent, because matrix multiplication is a linear operation).</p>
<p>Therefore we can think of axon-terminal-synapse interactions between neurons as a matrix multiplication between two real-valued matrices.</p>
<h3>Estimation of cerebellar input/output dimensions</h3>
<p>Cerebellar granule neurons typically receive inputs from about four axons (most often connections from the cortex). Each axon forms about 3-4 synapses with the dendritic claw of the granule neuron (a dendrite ending shaped as if you would hold a tennis ball in your hand) so there are a total of about 15 inputs via synapses to the granule neurons. The granule neuron itself ends in a T shaped axon which crosses directly through the dendrites of Purkinje neurons with which it forms about 100 synapses.</p>
<p>Purkinje neurons receive inputs from about 100000 connections made with granule neurons and they themselves make about 1000 connections in the deep nuclei. There are estimates which are much higher and no accurate number for the number of synapses exists as far as I know. The number of 100000 synapses might be a slight overestimate (but 75000 would be too conservative), but I use it anyways to make the math simpler.</p>
<p>All these dimensions are taken times the time dimension as discussed above, so that the input for granule neurons for example has a dimensionality of 15&#215;5.</p>
<p>So with this we can finally calculate the complexity of a cerebellar granule neuron together with the Purkinje neurons.</p>
<p><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_computational_estimate.png?ssl=1"><img data-attachment-id="334" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/brain_computational_estimate/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_computational_estimate.png?fit=776%2C493&amp;ssl=1" data-orig-size="776,493" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="brain_computational_estimate" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_computational_estimate.png?fit=300%2C191&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_computational_estimate.png?fit=776%2C493&amp;ssl=1" class="aligncenter wp-image-334 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/brain_computational_estimate.png?resize=776%2C493&#038;ssl=1" alt="brain_computational_estimate" width="776" height="493" data-recalc-dims="1" /></a></p>
<p>So my estimate would be 1.075&#215;10^21 FLOPS for the brain, the fastest computer on earth as of July 2013 has 0.58&#215;10^15 FLOPS for practical application (more about this below).</p>
<h3>Part III: Limitations and criticism</h3>
<p>While I discussed how the brain is similar to deep learning, I did not discuss how the brain is different. One great disparity is that the dropout in the brain works with respect to all inputs, while dropout in a convolutional network works with respect to each single unit. What the brain is doing makes little sense in deep learning right now; however, if you think about combining millions of convolutional nets with each other, it makes good sense to do as the brain does. The dropout of the brain certainly would work well to decouple the activity of neurons from each other, because no neuron can depend on information from a single other neuron (because it might be dropped out), so that it is forced to take into account all the neurons it is connected with, thus eliminating biased computation (which is basically regularization).</p>
<p>Another limitation of the model is that it is a lower bound. This estimate does not take into account:</p>
<ul>
<li>Backpropagation, i.e. signals that travel from the soma to the dendrites; the action potential is reflected within the axon and travels backwards (these two things may almost double the complexity)</li>
<li>Axon terminal information processing</li>
<li>Multi-neurotransmitter vesicles (can be thought of multiple output channels or filters, just as an image has multiple colors)</li>
<li>Geometrical shape of the dendritic tree</li>
<li>Dendritic spine information processing</li>
<li>Non-axodendritic synapses (axon-axon and axon-soma connections)</li>
<li>Electrical synapses</li>
<li>Neurotransmitter induced protein activation and signaling</li>
<li>Neurotransmitter induced gene regulation</li>
<li>Voltage induced (dendritic spikes and backpropagating signals) gene regulation</li>
<li>Voltage induced protein activation and signaling</li>
<li>Glia cells (besides having an extremely abnormal brain (about one in a billion), Einstein also had abnormally high levels of glia cells)</li>
</ul>
<p>All these things have been shown to be important for information processing in the brain. I did not include them in my estimate because this would have made everything:</p>
<ul>
<li>Too complex: What I have discussed so far is extremely simple if you compare that to the vastness and complexity of biological information processing</li>
<li>Too special: Non-axodendritic synapses can have unique information processing algorithms completely different from everything listed here, e.g. direct electrical communication between a neighboring bundle of neurons</li>
<li>And/or evidence is lacking to create a reliable mathematical model: Neural backpropagation, geometry of the dendritic trees, and dendritic spines</li>
</ul>
<p>Remember that these estimates are for the whole brain. Local brain regions might have higher computational processing speed than this average when they are actively processing stimuli. Also remember that the cerebellum makes up almost all computational processing. Other brain regions integrate the knowledge of the cerebellum, but the cerebellum acts as a transformation and abstraction module for almost all information in the brain (except vision and hearing).</p>
<h3>But wait, but we can do all this with much less computational power! We already have super-human performance in computer vision!</h3>
<p>I would not say that we have super-human performance in computer vision. What we have is a system that beats human at naming things in images that are taken out of context of the real world (what happens before we see something in the real world shapes our perception dramatically). We almost always can recognize things in our environment, but we most often just do not know (or care about) the name of what we see.</p>
<p>Humans do not have the visual system to label things. Try to make a list of 1000 common physical objects in the real world —not an easy task.</p>
<p>To not recognize an object for us humans would mean that we see an object but cannot make sense of it. If you forgot the name of an old classmate, it does not mean you did not recognize her; it just means you forgot her name. Now imagine you get off a train stop and you know a good friend is waiting for you somewhere at the stop. You see somebody 300 meters away waving their hands who is looking in your direction — is it your friend? You do not know; you cannot recognize if it is her. That’s the difference between mere labels and object recognition.</p>
<p>Now if you cannot recognize something in a 30&#215;30 pixel image, but the computer can, this also does not necessarily mean that the computer has super-human object recognition performance. First and foremost this means that your visual system does not work well for pixeled information. Our eyes are just not used to that.</p>
<p>Now take a look outside a window and try to label all the things you see. It will be very easy for most things, but for other things you do not know the correct labels! For example, I do not know the name for a few plants that I see when I look out of my window. However, we are fully aware what it is what we see and can name many details of the object. For example, alone by assessing their appearance, I know a lot about how much water and sunshine the unknown plants need, how fast they grow, in which way they grow, if they are old or young specimens; I know how they feel like if I touch them — or more generally — I know how these plants grow biologically and how they produce energy, and so on. I can do all this without knowing its name. Current deep learning systems cannot do this and will not do this for quite some time. Human-level performance in computer vision is far away indeed! We just reached the very first step (object recognition) and now the task is to make computer vision smart, rather than making it just good at labeling things.</p>
<p>Evolutionarily speaking, the main functions of our visual system have little to do with naming things that we see: Hunt and avoid being hunted, to orient ourselves in nature during foraging and make sure we pick the right berries and extract roots efficiently— these are all important functions, but probably one of the most important functions of our vision is the social function within a group or relationship.</p>
<p>If you Skype with someone it is quite a different communication when they have their camera enabled compared to if they have not. It is also very different to communicate with someone whose image is on a static 2D surface compared to communicating in person. Vision is critical for communication.</p>
<p>Our deep learning cannot do any of this efficiently.</p>
<h3>Making sense of a world without labels</h3>
<p>One striking case which also demonstrates the power of vision for true understanding of the environment without any labels is the case of <a href="https://en.wikipedia.org/wiki/Genie_(feral_child)">Genie</a>. Genie was strapped into place and left alone in a room at the age of 20 months. She was found with severe malnutrition 12 years later. She had almost no social interaction during this time and thus did not acquire any form of verbal language.</p>
<p>Once she got in contact with other human beings she was taught English as a language (and later also sign language), but she never really mastered it. Instead she quickly mastered non-verbal language and was truly exceptional at that.</p>
<p>To strangers she almost exclusively communicated with non-verbal language. There are instances where these strangers would stop in their place, leave everything behind, walk up to her and hand her a toy or another item — that item was always something that was known to be something liked and desired.</p>
<p>In one instance a woman got out of her car at a stoplight at an intersection, emptied her purse and handed it to Genie. The woman and Genie did not exchange a word; they understood each other completely non-verbally.</p>
<p>So what Genie did, was to pick up cues with her visual system and translated the emotional and cognitive state of that woman into non-verbal cues and actions, which she would then use to change the mental state of the woman. In turn that the woman would then desire to give the purse to Genie (which Genie probably could not even see).</p>
<p>Clearly, Genie was very exceptional at non-verbal communication — but what would happen if you pitched her against a deep learning object recognition system? The deep learning system would be much better than Genie on any data set you would pick. Do you think it would be fair to say that the convolutional net is better at object recognition than Genie is? I do not think so.</p>
<p>This shows how primitive and naïve our approach to computer vision is. Object recognition is a part of human vision, but it is not what makes it exceptional.</p>
<h3>Can we do with less computational power?</h3>
<p>“We do not need as much computational power as the brain has, because our algorithms are (will be) better than that of the brain.”</p>
<p>I hope you can see after the descriptions in this blog post that this statement is rather arrogant.</p>
<p>We do not know how the brain really learns. We do not understand information processing in the brain in detail. And yet we dare to say we can do better?</p>
<p>Even if we did know how the brain works in all its details, it would still be rather naïve to think we could create general intelligence with much less. The brain developed during many hundreds of millions of years through evolution. Evolutionary, it is the most malleable organ there is: The human cortex shrunk by about 10% during the last 20000 years, and the human brain adapted rapidly to the many ways we use verbal language — a very recent development in evolutionary terms.</p>
<p>It was also shown that the number of neurons in each animal’s brain is almost exactly the amount which it can sustain through feeding (we probably killed off the majority of all mammoths by about 20000 years ago). We humans have such large brains because we invented fire and cooking with which we could predigest food which made it possible to sustain more neurons. Without cooking, the intake of calories would not be high enough to sustain our brains and we would helplessly starve (at least a few thousand years ago; now you could survive on a raw vegan diet easily — just walk into a supermarket and buy a lot of calorie-dense foods). With this fact, it is very likely that brains are optimized exhaustively to create the best information processing which is possible for the typical calorie intake of the respective species — the function which is most expensive in an animal will be most ruthlessly optimized to enhance survival and procreation. This is also very much in line with all the complexity of the brain; every little function is optimized thoroughly and only as technology advances we can understand step by step what this complexity is made for.</p>
<p>There are many hundreds of different types of neurons in the brain, each with their designated function. Indeed, neuroscientists often can differentiate different brain regions and their function by looking at the changing architecture and neuron types in a brain region. Although we do not understand the details of how the circuits perform information processing, we can see that each of these unique circuits is designed carefully to perform a certain kind of function. These circuits are often replicated in evolutionary distinct species which share a common ancestor that branched off into these different species hundreds of millions of years ago, showing that such structures are evolutionarily optimal for the tasks they are processing.</p>
<p>The equivalent in deep learning would be, if we had 10000 different architectures of convolutional nets (with its own set of activation functions and more) which we combine meticulously to improve the overall function of our algorithm ― do you really think we can build something which can produce as complex information processing, but which follows a simple general architecture?</p>
<p>It is rather naïve to think that we can out-wit this fantastically complex organ when we are not even able to understand its learning algorithms.</p>
<p>On top of this, the statement that we will develop better algorithms than the brain uses is unfalsifiable. We can only prove it when we achieve it, we cannot disprove it. Thus it is a rather nonsensical statement that has little practical value. Theories are usually useful even when there is not enough evidence to show that they are correct.</p>
<p>The standard model of physics is an extremely useful theory used by physicists and engineers around the world in their daily life to develop the high tech products we enjoy; and yet this theory is not complete, it was amended just a few days ago when a new particle was proven to exist in the LHC experiment.</p>
<p>Imagine if there were another model, but you would only be able to use it when we have proven the existence of <em>all particles</em>. This model would then be rather useless. When it makes no predictions at all about the behavior in the world, we would be unable to manufacture and develop electronics with this theory. Similarly, the statement that we can develop more efficient algorithms than the brain does not help; it rather makes it more difficult to make further progress. The brain should really be our main point of orientation.</p>
<p>Another argument, which would be typical for Yann LeCun (he made a similar argument during a panel) would be: Arguably, airplanes are much better at flying than birds are; yet, if you describe the flight of birds it is extremely complex and every detail counts, while the flight of airplanes is described simply by the fluid flow around an airfoil. Why is it wrong to expect this simplicity from deep learning when compared to the brain?</p>
<p>I think this argument has some truth in it, but essentially, it asks the wrong question. I think it is clear that we need not to replicate everything in detail in order to achieve artificial intelligence, but the real question is: Where do we draw the line? If you get to know that neurons can be modeled in ways that closely resemble convolutional nets, would you go so far and say, that this model is too complex and we need to make it simpler?</p>
<h2>Part IV: Predicting the growth of practical computational power</h2>
<p>There is one dominant measure of performance in high-performance computing (HPC) and this measure is floating point operations per second (FLOPS) on the High Performance LINPACK (HPL) benchmark – which measures how many computations a system can do in a second when doing distributed dense matrix operations on hundreds or thousands of computers. There exists the TOP 500 list of supercomputers, which is a historical list based on this benchmark which is the main reference point for the performance of a new supercomputer system.</p>
<p>But a big but comes with the LINPACK benchmark. <a href="http://www.netlib.org/utk/people/JackDongarra/PAPERS/HPCG-benchmark.pdf">It does not reflect the performance in real, practical applications</a> which run on modern supercomputers on a daily basis, and thus, the fastest computers on the TOP 500 list are not necessarily the fastest computers for practical applications.</p>
<p>Everybody in the high performance computing community knows this, but it is so entrenched in the business routine in this area, that when you design a new supercomputer system, you basically have to show that your system will be able to get a good spot on the TOP 500 in order to get funding for that supercomputer.</p>
<p>Sometimes such systems are practically unusable, like the Tianhe-2 supercomputer which still holds the top spot on the LINPACK benchmark after more than three years. The potential of this supercomputer goes largely unused because it is too expensive to run (electricity) and the custom hardware (custom network, Intel Xeon Phi) requires new software, which would need years of development to reach the levels of sophistication of standard HPC software. The Tianhe-2 runs only at roughly one third of its capacity, or in other words, it practically stands idle for nearly 2 out of 3 minutes. The predecessor of the Tianhe-2, the Tianhe-1, fastest computer in the world in 2010 (according to LINPACK), has not been used since 2013 due to bureaucracy reasons.</p>
<p>While outside of China, other supercomputers of similar design fare better, they typically do not perform so well in practical applications. This is so, because the used accelerators like graphic processing units (GPUs) or Intel Xeon Phis can deliver high FLOPS in such a setup, but they are severely limited by network bandwidth bottlenecks.</p>
<p>To correct the growing uselessness of the LINPACK benchmark a new measure of performance was developed: The high performance conjugate gradient benchmark (HPCG). This benchmark performs conjugate gradient, which requires more communication than LINPACK and as such comes much closer to performance numbers for real applications. I will use this benchmark to create my estimates for a singularity.</p>
<figure id="attachment_327" aria-describedby="caption-attachment-327" style="width: 1000px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/top500_2.jpg?ssl=1"><img data-attachment-id="327" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/top500_2/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/top500_2.jpg?fit=1000%2C800&amp;ssl=1" data-orig-size="1000,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="top500_2" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/top500_2.jpg?fit=300%2C240&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/top500_2.jpg?fit=1000%2C800&amp;ssl=1" class="wp-image-327 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/top500_2.jpg?resize=1000%2C800&#038;ssl=1" alt="top500_2" width="1000" height="800" data-recalc-dims="1" /></a><figcaption id="caption-attachment-327" class="wp-caption-text">The TOP500 for the last decade and some data for the HPCG (data collection only began recently). The dashed lines indicate a forecast. The main drivers of computational growth are also shown: Multicore CPU, GPU, and in 2016-2017 3D memory, and some new unknown technology in 2020. Will this growth be sustainable?</figcaption></figure>
<p>However, this benchmark still dramatically overestimates the computing power that can be reached for artificial intelligence applications when we assume that these applications are based on deep learning.</p>
<p>Deep learning is currently the most promising technique for reaching artificial intelligence. It is certain that deep learning — as it is now — will not be enough, but one can say for sure that something similar to deep learning will be involved in reaching strong AI.</p>
<p>Deep learning, unlike other applications has an unusually high demand for network bandwidth. It is so high that for some supercomputer designs which are in the TOP 500 a deep learning application would run slower than on your desktop computer. Why is this so? Because parallel deep learning involves massive parameter synchronization which requires extensive network bandwidth: If your network bandwidth is too slow, then at some point deep learning gets slower and slower the more computers you add to your system. As such, very large systems which are usually quite fast may be extremely slow for deep learning.</p>
<p>The problem with all this is that the development of new network interconnects which enable high bandwidth is difficult and advances are made much more slowly than the advances of computing modules, like CPUs, GPUs and other accelerators. Just recently, Mellanox reached a milestone where they could manufacture switches and InfiniBand cards which operate at 100Gbits per second. This development is still rather experimental, and it is difficult to manufacture fiber-optic cables which can operate at this speed. As such, no supercomputer implements this new development as of yet. But with this milestone reached, there will not be another milestone for many quite a while. The doubling time for network interconnect bandwidth is about 3 years.</p>
<p>Similarly, there is a memory problem. While the speed of theoretical processing power of CPUs and GPUs keeps increasing, the memory bandwidth of RAM is almost static. This is a great problem, because now we are at a point where it costs more time to move the data to the compute circuits than to actually make computations with it.</p>
<p>With new developments such as 3D memory one can be sure that further increases in memory bandwidth will be achieved, but we have nothing after that to increase the performance further. We need new ideas and new technology. Memory will not scale itself by getting smaller and smaller.</p>
<p>However, currently the biggest hurdle of them all is power consumption. The Tianhe-2 uses 24 megawatts of power, which totals to $65k-$100k in electricity cost per day, or about $23 million per year. The power consumed by the Tianhe-2 would be sufficient to power about 6000 homes in Germany or 2000 homes in the US (A/C usage).</p>
<figure id="attachment_345" aria-describedby="caption-attachment-345" style="width: 753px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hpc_constraints.png?ssl=1"><img data-attachment-id="345" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/hpc_constraints/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hpc_constraints.png?fit=753%2C476&amp;ssl=1" data-orig-size="753,476" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="hpc_constraints" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hpc_constraints.png?fit=300%2C190&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hpc_constraints.png?fit=753%2C476&amp;ssl=1" class="wp-image-345 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/hpc_constraints.png?resize=753%2C476&#038;ssl=1" alt="hpc_constraints" width="753" height="476" data-recalc-dims="1" /></a><figcaption id="caption-attachment-345" class="wp-caption-text">An overview about how the performance constraints changed from old to new supercomputers. Adapted from <a href="https://www2.lbl.gov/Publications/Deputy-Director/bio.html">Horst Simon</a>&#8216;s <a href="https://www.researchgate.net/profile/Horst_Simon/publication/261879110_Why_we_need_Exascale_and_why_we_won't_get_there_by_2020/links/0c960535dbade00bbc000000.pdf">presentation</a></figcaption></figure>
<h3>Physical limitations</h3>
<p>Furthermore, there are physical problems around the corner. Soon, our circuits will be so small that electrons will start to show quantum effects. One such quantum effect is quantum tunneling. In quantum tunneling an electron sits in two neighboring circuits at once, and decides randomly to which of these two locations it will go next.</p>
<p>If this would happen at a larger scale, it would be like charging your phone right next to your TV, and the electrons decide they want to go to your cell phone cable rather than to your TV; so they jump over to the phone cable cutting off the power to your TV. Quantum tunneling will become relevant in 2016-2017 and has to be taken into account from there on. New materials and “insulated” circuits are required to make everything work from here on.</p>
<p>With new materials, we need new production techniques which will be very costly because all computer chips relied on the same, old but reliable production process. We need research and development to make our known processes working with these new materials and this will not only cost money but also cost time. This will also fuel a continuing trend where the cost for producing computer chips increases exponentially (and growth may slow due to costs). Currently, the tally is at $9bn for such a semiconductor fabrication plant (fab) increasing at a relatively stable rate of about 7-10% higher costs per year for the past decades.</p>
<p>After this, we are at the plain physical limits. A transistor will be composed of not much more than a handful of atoms. We cannot go smaller than this, and this level of manufacturing will require extensive efforts in order to get such devices working properly. This will start to happen around 2025 and the growth may slow from here due to physical limitations.</p>
<h3>Recent trends in the growth of computational power</h3>
<p>So to summarize the previous section: (1) LINPACK performance does not reflect practical performance because it does not test memory and network bandwidth constraints; (2) memory and network bandwidth are now more important than computational power, however (3) advances in memory and network bandwidth will be sporadic and cannot compete with the growth in computational power; (4) electrical costs are a severe limitation (try to justify a dedicated power plant for a supercomputer if citizen face sporadic power outages), and also (5) computational power will be limited by physical boundaries in the next couple of years.</p>
<p>It may not come to a surprise then that the growth in computational power has been slowing down in recent years; this is mainly due to power efficiencies which will only be improved gradually, but the other factors also take its toll, like network interconnects which cannot keep up with accelerators like GPUs.</p>
<p>If one takes the current estimate of practical FLOPS of the fastest supercomputer, the Tianhe-2 with 0.58 petaflops on HPCG, then it would take 21 doubling periods until the lower bound of the brain&#8217;s computational power is reached. If one uses Moore’s Law, we would reach that by 2037; if we take the growth of the last 60 years, which is about 1.8 years per doubling period, we will reach this in the year 2053. If we take a lower estimate of 3 years for the doubling period due to the problems listed above we will reach this in 2078. While for normal supercomputing applications memory bandwidth is the bottleneck for practical applications as of now, this may soon change to networking bandwidth, which doubles about every 3 years. So the 2078 estimate might be quite accurate.</p>
<figure id="attachment_328" aria-describedby="caption-attachment-328" style="width: 893px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/growth.jpg?ssl=1"><img data-attachment-id="328" data-permalink="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/growth/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/growth.jpg?fit=893%2C634&amp;ssl=1" data-orig-size="893,634" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="growth" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/growth.jpg?fit=300%2C213&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/growth.jpg?fit=893%2C634&amp;ssl=1" class="wp-image-328 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/07/growth.jpg?resize=893%2C634&#038;ssl=1" alt="growth" width="893" height="634" data-recalc-dims="1" /></a><figcaption id="caption-attachment-328" class="wp-caption-text">Growth in computing performance with respect to the HPCG benchmark. Both computing performance and factory costs are assumed to keep growing steadily at an exponential rate with doubling period of 18 or 36 months, respectively.</figcaption></figure>
<p>Now remember that, (1) the HPCG benchmark has much higher performance than typical deep learning applications which rely much more on network and memory bandwidth, and (2) that my estimate for the computational complexity of the brain is a lower bound. One can see that an estimate beyond 2100 might be not too far off. To sustain such a long and merciless increase in computation performance will require that we develop and implement many new ideas while operating at the border of physical limitations as soon as by 2020. Will this be possible?</p>
<p>Where there&#8217;s a will, there&#8217;s a way — the real question is: Are we prepared to pay the costs?</p>
<h1>Conclusion</h1>
<p>Here I have discussed the information processing steps of the brain and their complexity and compared them to those of deep learning algorithms. I focused on a discussion of basic electrochemical information processing and neglected biological information processing.</p>
<p>I used an extended linear-nonlinear-Poisson cascade model as groundwork and related it to convolutional architectures.</p>
<p>With this model, I could show that a single neuron has an information processing architecture which is very similar to current convolutional nets, featuring convolutional stages with rectified non-linearities which activities are then regularized by a dropout-like method. I also established a connection between max-pooling and voltage-gated channels which are opened by dendritic spikes. Similarities to batch-normalization exist.</p>
<p>This straightforward similarity gives strong reason to believe that deep learning is really on the right path. It also indicates that ideas borrowed from neurobiological processes are useful for deep learning (the problem was that progress in deep learning architectures often preceded knowledge in neurobiological processes).</p>
<p>My model shows that it can be estimated that the brain operates at least 10x^21 operations per second. With current rates of growth in computational power we could achieve supercomputers with brain-like capabilities by the year 2037, but estimates after the year 2080 seem more realistic when all evidence is taken into account. This estimate only holds true if we succed to stomp limitations like physical barriers (for example quantum-tunneling), capital costs for semiconductor fabrication plants, and growing electrical costs. At the same time we constantly need to innovate to solve memory bandwidth and network bandwidth problems which are or will be the bottlenecks in supercomputing. With these considerations taken into account, it is practically rather unlikely that we will achieve human-like processing capabilities anytime soon.</p>
<h2>Closing remarks</h2>
<p>My philosophy of this blog post was to present all information on a single web-page rather than scatter information around. I think this design helps to create a more sturdy fabric of knowledge, which, with its interwoven strains of different fields, helps to create a more thorough picture of the main ideas involved.  However, it has been quite difficult to organize all this information into a coherent picture and some points might be more confusing than enlightening. Please leave a comment below to let me know if the structure and content need improvement, so that I can adjust my next blog post accordingly.</p>
<p>I would also love general feedback for this blog post.</p>
<p>Also make sure to share this blog post with your fellow deep learning colleagues. People with raw computer science backgrounds often harbor misconceptions about the brain, its parts and how it works. I think this blog post could be a suitable remedy for that.</p>
<h2>The next blog post</h2>
<p>The second post in this series on neuroscience and psychology will focus on the most important brain regions and their function and connectivity. The last and third part in the series will focus on psychological processes, such as memory and learning, and what we can learn from that with respect to deep learning.</p>
<h4><strong>Acknowledgments</strong></h4>
<p>I would like to thank Alexander Tonn for his useful advice and for proofreading this blog post.</p>
<h4><strong>Important references and sources </strong></h4>
<p><strong>Neuroscience</strong></p>
<p>Brunel, N., Hakim, V., &amp; Richardson, M. J. (2014). Single neuron dynamics and computation. <i>Current opinion in neurobiology</i>, <i>25</i>, 149-155.</p>
<p>Chadderton, P., Margrie, T. W., &amp; Häusser, M. (2004). Integration of quanta in cerebellar granule cells during sensory processing. <i>Nature</i>, <i>428</i>(6985), 856-860.</p>
<p>De Gennaro, L., &amp; Ferrara, M. (2003). Sleep spindles: an overview. <i>Sleep medicine reviews</i>, <i>7</i>(5), 423-440.</p>
<p>Ji, D., &amp; Wilson, M. A. (2007). Coordinated memory replay in the visual cortex and hippocampus during sleep. <i>Nature neuroscience</i>, <i>10</i>(1), 100-107.</p>
<p>Liaw, J. S., &amp; Berger, T. W. (1999). Dynamic synapse: Harnessing the computing power of synaptic dynamics. <i>Neurocomputing</i>, <i>26</i>, 199-206.</p>
<p>Ramsden, S., Richardson, F. M., Josse, G., Thomas, M. S., Ellis, C., Shakeshaft, C., &#8230; &amp; Price, C. J. (2011). Verbal and non-verbal intelligence changes in the teenage brain. <i>Nature</i>, <i>479</i>(7371), 113-116.</p>
<p>Smith, S. L., Smith, I. T., Branco, T., &amp; Häusser, M. (2013). Dendritic spikes enhance stimulus selectivity in cortical neurons in vivo. <i>Nature</i>, <i>503</i>(7474), 115-120.</p>
<p><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3230671/">Stoodley, C. J., &amp; Schmahmann, J. D. (2009). Functional topography in the human cerebellum: a meta-analysis of neuroimaging studies. <i>Neuroimage</i>,<i>44</i>(2), 489-501.</a></p>
<p><strong>High performance computing</strong></p>
<p>Dongarra, J., &amp; Heroux, M. A. (2013). Toward a new metric for ranking high performance computing systems. <i>Sandia Report, SAND2013-4744</i>, <i>312</i>.</p>
<p><a href="https://prod-ng.sandia.gov/techlib-noauth/access-control.cgi/2013/138752.pdf">PDF: HPCG Specification</a></p>
<p><a href="https://top500.org/news/no-exascale-for-you-an-interview-with-berkeley-labs-horst-simon/">Interview: Why there will be no exascale computing before 2020</a></p>
<p><a href="https://www.researchgate.net/profile/Horst_Simon/publication/261879110_Why_we_need_Exascale_and_why_we_won't_get_there_by_2020/links/0c960535dbade00bbc000000.pdf">Slides: Why there will be no exascale computing before 2020</a></p>
<p><a href="http://vrworld.com/2015/03/23/jack-dongarra-on-the-great-exascale-challenge-and-rising-hpc-powers/">Interview: Challenges of exascale computing</a></p>
<p><strong>Image references</strong></p>
<p><a id="anwar14"></a><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4107854/">Anwar, H., Roome, C. J., Nedelescu, H., Chen, W., Kuhn, B., &amp; De Schutter, E. (2014). Dendritic diameters affect the spatial variability of intracellular calcium dynamics in computer models. <i>Frontiers in cellular neuroscience</i>, <i>8</i>.</a></p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/">The Brain vs Deep Learning Part I: Computational Complexity — Or Why the Singularity Is Nowhere Near</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://timdettmers.com/2015/07/27/brain-vs-deep-learning-singularity/feed/</wfw:commentRss>
			<slash:comments>183</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">312</post-id>	</item>
		<item>
		<title>Understanding Convolution in Deep Learning</title>
		<link>https://timdettmers.com/2015/03/26/convolution-deep-learning/</link>
					<comments>https://timdettmers.com/2015/03/26/convolution-deep-learning/#comments</comments>
		
		<dc:creator><![CDATA[Tim Dettmers]]></dc:creator>
		<pubDate>Thu, 26 Mar 2015 22:08:00 +0000</pubDate>
				<category><![CDATA[Deep Learning]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Convolution]]></category>
		<guid isPermaLink="false">https://timdettmers.wordpress.com/?p=192</guid>

					<description><![CDATA[<p>Convolution is probably the most important concept in deep learning right now. It was convolution and convolutional nets that catapulted deep learning to the forefront of almost any machine learning task there is. But what makes convolution so powerful? How does it work? In this blog post I will explain convolution and relate it to other concepts that will help you to understand convolution thoroughly.</p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2015/03/26/convolution-deep-learning/">Understanding Convolution in Deep Learning</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">Convolution is probably the most important concept in deep learning right now. It was convolution and convolutional nets that catapulted deep learning to the forefront of almost any machine learning task there is. But what makes convolution so powerful? How does it work? In this blog post I will explain convolution and relate it to other concepts that will help you to understand convolution thoroughly.</p>
<p style="text-align: justify;"><span id="more-192"></span></p>
<p style="text-align: justify;">There are already some blog post regarding convolution in deep learning, but I found all of them highly confusing with unnecessary mathematical details that do not further the understanding in any meaningful way. This blog post will also have many mathematical details, but I will approach them from a conceptual point of view where I represent the underlying mathematics with images everybody should be able to understand. The first part of this blog post is aimed at anybody who wants to understand the general concept of convolution and convolutional nets in deep learning. The second part of this blog post includes advanced concepts and is aimed to further and enhance the understanding of convolution for deep learning researchers and specialists.</p>
<h3 style="text-align: justify;">What is convolution?</h3>
<p style="text-align: justify;">This whole blog post will build up to answer exactly this question, but it may be very helpful to first understand in which direction this is going, so what is convolution in rough terms?</p>
<p style="text-align: justify;">You can imagine convolution as the mixing of information. Imagine two buckets full of information which are poured into one single bucket and then mixed according to a specific rule. Each bucket of information has its own recipe, which describes how the information in one bucket mixes with the other. So convolution is an orderly procedure where two sources of information are intertwined.</p>
<p style="text-align: justify;">Convolution can also be described mathematically, in fact, it is a mathematical operation like addition, multiplication or a derivative, and while this operation is complex in itself, it can be very useful to simplify even more complex equations. Convolutions are heavily used in physics and engineering to simplify such complex equations and in the second part — after a short mathematical development of convolution — we will relate and integrate ideas between these fields of science and deep learning to gain a deeper understanding of convolution. But for now we will look at convolution from a practical perspective.</p>
<h3 style="text-align: justify;">How do we apply convolution to images?</h3>
<p style="text-align: justify;">When we apply convolution to images, we apply it in two dimensions — that is the width and height of the image. We mix two buckets of information: The first bucket is the input image, which has a total of three matrices of pixels — one matrix each for the red, blue and green color channels; a pixel consists of an integer value between 0 and 255 in each color channel. The second bucket is the convolution kernel, a single matrix of floating point numbers where the pattern and the size of the numbers can be thought of as a recipe for how to intertwine the input image with the kernel in the convolution operation. The output of the kernel is the altered image which is often called a feature map in deep learning. There will be one feature map for every color channel.</p>
<figure id="attachment_195" aria-describedby="caption-attachment-195" style="width: 500px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution.png?ssl=1"><img data-attachment-id="195" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/convolution/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution.png?fit=388%2C150&amp;ssl=1" data-orig-size="388,150" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="convolution" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution.png?fit=300%2C116&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution.png?fit=388%2C150&amp;ssl=1" class="wp-image-195" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution.png?resize=500%2C193&#038;ssl=1" alt="convolution" width="500" height="193" data-recalc-dims="1" /></a><figcaption id="caption-attachment-195" class="wp-caption-text">Convolution of an image with an edge detector convolution kernel. Sources: <a href="https://en.wikipedia.org/wiki/File:Vd-Orig.png">1</a> <a href="https://en.wikipedia.org/wiki/File:Vd-Edge3.png">2</a></figcaption></figure>
<p style="text-align: justify;">We now perform the actual intertwining of these two pieces of information through convolution. One way to apply convolution is to take an image patch from the input image of the size of the kernel — here we have a 100&#215;100 image, and a 3&#215;3 kernel, so we would take 3&#215;3 patches — and then do an element wise multiplication with the image patch and convolution kernel. The sum of this multiplication then results in <em>one</em> pixel of the feature map. After one pixel of the feature map has been computed, the center of the image patch extractor slides one pixel into another direction, and repeats this computation. The computation ends when all pixels of the feature map have been computed this way. This procedure is illustrated for one image patch in the following gif.</p>
<figure id="attachment_193" aria-describedby="caption-attachment-193" style="width: 500px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/aa-convolution-02.gif?ssl=1"><img data-attachment-id="193" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/aa-convolution-02/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/aa-convolution-02.gif?fit=360%2C300&amp;ssl=1" data-orig-size="360,300" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="aa-convolution-02" data-image-description="" data-image-caption="&lt;p&gt;Calculating convolution by operating on images patches.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/aa-convolution-02.gif?fit=300%2C250&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/aa-convolution-02.gif?fit=360%2C300&amp;ssl=1" class="wp-image-193" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/aa-convolution-02.gif?resize=500%2C417&#038;ssl=1" alt="Calculating convolution by operating on images patches." width="500" height="417" data-recalc-dims="1" /></a><figcaption id="caption-attachment-193" class="wp-caption-text"><strong>Convolution operation for one pixel of the resulting feature map:</strong> One image patch (red) of the original image (RAM) is multiplied by the kernel, and its sum is written to the feature map pixel (Buffer RAM). <a href="http://williamson-labs.com/convolution-2d.htm">Gif</a> by <a href="http://williamson-labs.com/contact.htm">Glen Williamson</a> who runs a <a href="http://williamson-labs.com/">website</a> that features many technical gifs.</figcaption></figure>
<p style="text-align: justify;">As you can see there is also a normalization procedure where the output value is normalized by the size of the kernel (9); this is to ensure that the total intensity of the picture and the feature map stays the same.</p>
<h3 style="text-align: justify;">Why is convolution of images useful in machine learning?</h3>
<p style="text-align: justify;">There can be a lot of distracting information in images that is not relevant to what we are trying to achieve. A good example of this is a project I did together with<a href="https://www.xing.com/profile/Janek_Thomas"> Jannek Thomas</a> in the Burda Bootcamp. The Burda Bootcamp is a rapid prototyping lab where students work in a hackathon-style environment to create technologically risky products in very short intervals. Together with my 9 colleagues, we created 11 products in 2 months. In one project I wanted to build a fashion image search with deep autoencoders: You upload an image of a fashion item and the autoencoder should find images that contain clothes with similar style.</p>
<p style="text-align: justify;">Now if you want to differentiate between styles of clothes, the colors of the clothes will not be that useful for doing that; also minute details like emblems of the brand will be rather unimportant. What is most important is probably the shape of the clothes. Generally, the shape of a blouse is very different from the shape of a shirt, jacket, or trouser. So if we could filter the unnecessary information out of images then our algorithm will not be distracted by the unnecessary details like color and branded emblems. We can achieve this easily by convoluting images with kernels.</p>
<p style="text-align: justify;">My colleague Jannek Thomas preprocessed the data and applied a Sobel edge detector (similar to the kernel above) to filter everything out of the image except the outlines of the shape of an object — this is why the application of convolution is often called filtering, and the kernels are often called filters (a more exact definition of this filtering processes will follow below). The resulting feature map from the edge detector kernel will be very helpful if you want to differentiate between different types of clothes, because only relevant shape information remains.</p>
<figure id="attachment_256" aria-describedby="caption-attachment-256" style="width: 700px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoencoder_fashion_features_and_results.png?ssl=1"><img data-attachment-id="256" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/autoencoder_fashion_features_and_results/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoencoder_fashion_features_and_results.png?fit=771%2C971&amp;ssl=1" data-orig-size="771,971" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="autoencoder_fashion_features_and_results" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoencoder_fashion_features_and_results.png?fit=238%2C300&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoencoder_fashion_features_and_results.png?fit=771%2C971&amp;ssl=1" class="wp-image-256 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoencoder_fashion_features_and_results.png?resize=700%2C882&#038;ssl=1" alt="autoencoder_fashion_features_and_results" width="700" height="882" data-recalc-dims="1" /></a><figcaption id="caption-attachment-256" class="wp-caption-text"><strong>Sobel filtered inputs to and results from the trained autoencoder:</strong> The top-left image is the search query and the other images are the results which have an autoencoder code that is most similar to the search query as measured by cosine similarity. You see that the autoencoder really just looks at the shape of the search query and not its color. However, you can also see that this procedure does not work well for images of people wearing clothes (5th column) and that it is sensitive to the shapes of clothes hangers (4th column).</figcaption></figure>
<p style="text-align: justify;">We can take this a step further: There are dozens of different kernels which produce many different feature maps, e.g. which sharpen the image (more details), or which blur the image (less details), and each feature map may help our algorithm to do better on its task (details, like 3 instead of 2 buttons on your jacket might be important).</p>
<p style="text-align: justify;">Using this kind of procedure — taking inputs, transforming inputs and feeding the transformed inputs to an algorithm — is called feature engineering. Feature engineering is very difficult, and there are little resources which help you to learn this skill. In consequence, there are very few people which can apply feature engineering skillfully to a wide range of tasks. Feature engineering is — hands down — the most important skill to score well in Kaggle competitions. Feature engineering is so difficult because for each type of data and each type of problem, different features do well: Knowledge of feature engineering for image tasks will be quite useless for time series data; and even if we have two similar image tasks, it will not be easy to engineer good features because the objects in the images also determine what will work and what will not. It takes a lot of experience to get all of this right.</p>
<p style="text-align: justify;">So feature engineering is very difficult and you have to start from scratch for each new task in order to do well. But when we look at images, might it be possible to automatically find the kernels which are most suitable for a task?</p>
<h3 style="text-align: justify;">Enter convolutional nets</h3>
<p style="text-align: justify;">Convolutional nets do exactly this. Instead of having fixed numbers in our kernel, we assign parameters to these kernels which will be trained on the data. As we train our convolutional net, the kernel will get better and better at filtering a given image (or a given feature map) for relevant information. This process is automatic and is called feature learning. Feature learning automatically generalizes to each new task: We just need to simply train our network to find new filters which are relevant for the new task. This is what makes convolutional nets so powerful — no difficulties with feature engineering!</p>
<p style="text-align: justify;">Usually we do not learn a single kernel in convolutional nets, instead we learn a hierarchy of multiple kernels at the same time. For example a 32x16x16 kernel applied to a 256&#215;256 image would produce 32 feature maps of size 241&#215;241 (this is the standard size, the size may vary from implementation to implementation; <img src="https://s0.wp.com/latex.php?latex=%7B%5Cmbox%7Bimage+size%7D+-+%5Cmbox%7Bkernel+size%7D+%2B+1%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{&#92;mbox{image size} - &#92;mbox{kernel size} + 1}" class="latex" />). So automatically we learn 32 new features that have relevant information for our task in them. These feature then provide the inputs for the next kernel which filters the inputs again. Once we learned our hierarchical features, we simply pass them to a fully connected, simple neural network that combines them in order to classify the input image into classes. That is nearly all that there is to know about convolutional nets at a conceptual level (pooling procedures are important too, but that would be another blog post).</p>
<h3 style="text-align: justify;">Part II: Advanced concepts</h3>
<p style="text-align: justify;">We now have a very good intuition of what convolution is, and what is going on in convolutional nets, and why convolutional nets are so powerful. But we can dig deeper to understand what is really going on within a convolution operation. In doing so, we will see that the original interpretation of computing a convolution is rather cumbersome and we can develop more sophisticated interpretations which will help us to think about convolutions much more broadly so that we can apply them on many different data. To achieve this deeper understanding the first step is to understand the convolution theorem.</p>
<h3 style="text-align: justify;">The convolution theorem</h3>
<p style="text-align: justify;">To develop the concept of convolution further, we make use of the convolution theorem, which relates convolution in the time/space domain — where convolution features an unwieldy integral or sum — to a mere element wise multiplication in the frequency/Fourier domain. This theorem is very powerful and is widely applied in many sciences. The convolution theorem is also one of the reasons why the fast Fourier transform (FFT) algorithm is thought by some to be one of the most important algorithms of the 20<sup>th</sup> century.</p>
<p style="text-align: justify;"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution-theorem1.png?ssl=1"><img data-attachment-id="299" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/convolution-theorem/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution-theorem1.png?fit=1550%2C263&amp;ssl=1" data-orig-size="1550,263" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="convolution theorem" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution-theorem1.png?fit=300%2C51&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution-theorem1.png?fit=1024%2C174&amp;ssl=1" class="aligncenter size-full wp-image-299" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution-theorem1.png?resize=700%2C119&#038;ssl=1" alt="convolution theorem" width="700" height="119" data-recalc-dims="1" /></a></p>
<p style="text-align: justify;">The first equation is the one dimensional continuous convolution theorem of two general continuous functions; the second equation is the 2D discrete convolution theorem for discrete image data. Here <img src="https://s0.wp.com/latex.php?latex=%7B%5Cotimes%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{&#92;otimes}" class="latex" /> denotes a convolution operation, <img src="https://s0.wp.com/latex.php?latex=%7B%5Cmathcal%7BF%7D%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{&#92;mathcal{F}}" class="latex" /> denotes the Fourier transform, <img src="https://s0.wp.com/latex.php?latex=%7B%5Cmathcal%7BF%7D%5E%7B-1%7D%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{&#92;mathcal{F}^{-1}}" class="latex" /> the inverse Fourier transform, and <img src="https://s0.wp.com/latex.php?latex=%7B%5Csqrt%7B2%5Cpi%7D%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{&#92;sqrt{2&#92;pi}}" class="latex" /> is a normalization constant. Note that &#8220;discrete&#8221; here means that our data consists of a countable number of variables (pixels); and 1D means that our variables can be laid out in one dimension in a meaningful way, e.g. time is one dimensional (one second after the other), images are two dimensional (pixels have rows and columns), videos are three dimensional (pixels have rows and columns, and images come one after another).</p>
<p style="text-align: justify;">To get a better understanding what happens in the convolution theorem we will now look at the interpretation of Fourier transforms with respect to digital image processing.</p>
<h3>Fast Fourier transforms</h3>
<p style="text-align: justify;">The fast Fourier transform is an algorithm that transforms data from the space/time domain into the frequency or Fourier domain. The Fourier transform describes the original function in a sum of wave-like cosine and sine terms. It is important to note, that the Fourier transform is generally complex valued, which means that a real value is transformed into a complex value with a real and imaginary part. Usually the imaginary part is only important for certain operations and to transform the frequencies back into the space/time domain and will be largely ignored in this blog post. Below you can see a visualization how a signal (a function of information often with a time parameter, often periodic) is transformed by a Fourier transform.</p>
<figure id="attachment_211" aria-describedby="caption-attachment-211" style="width: 500px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_transform_time_and_frequency_domains.gif?ssl=1"><img data-attachment-id="211" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/fourier_transform_time_and_frequency_domains/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_transform_time_and_frequency_domains.gif?fit=500%2C400&amp;ssl=1" data-orig-size="500,400" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Fourier_transform_time_and_frequency_domains" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_transform_time_and_frequency_domains.gif?fit=300%2C240&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_transform_time_and_frequency_domains.gif?fit=500%2C400&amp;ssl=1" class="wp-image-211 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_transform_time_and_frequency_domains.gif?resize=500%2C400&#038;ssl=1" alt="Fourier_transform_time_and_frequency_domains" width="500" height="400" data-recalc-dims="1" /></a><figcaption id="caption-attachment-211" class="wp-caption-text">Transformation of the time domain (red) into the frequency domain (blue). <a href="https://commons.wikimedia.org/wiki/File:Fourier_transform_time_and_frequency_domains.gif">Source</a></figcaption></figure>
<p style="text-align: justify;">You may be unaware of this, but it might well be that you see Fourier transformed values on a daily basis: If the red signal is a song then the blue values might be the equalizer bars displayed by your mp3 player.</p>
<h3>The Fourier domain for images</h3>
<figure id="attachment_213" aria-describedby="caption-attachment-213" style="width: 549px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier-transforms.png?ssl=1"><img data-attachment-id="213" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/fourier-transforms/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier-transforms.png?fit=549%2C559&amp;ssl=1" data-orig-size="549,559" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="fourier_transforms" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier-transforms.png?fit=295%2C300&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier-transforms.png?fit=549%2C559&amp;ssl=1" class="wp-image-213 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier-transforms.png?resize=549%2C559&#038;ssl=1" alt="fourier Transforms" width="549" height="559" data-recalc-dims="1" /></a><figcaption id="caption-attachment-213" class="wp-caption-text">Images by <a href="#fisher1998">Fisher &amp; Koryllos (1998)</a>. <a href="http://homepages.inf.ed.ac.uk/rbf/">Bob Fisher</a> also runs an excellent <a href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/hipr_top.htm">website</a> about <a href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm">Fourier transforms</a> and image processing in general.</figcaption></figure>
<p style="text-align: justify;">How can we imagine frequencies for images? Imagine a piece of paper with one of the two patterns from above on it. Now imagine a wave traveling from one edge of the paper to the other where the wave pierces through the paper at each stripe of a certain color and hovers over the other. Such waves pierce the black and white parts in specific intervals, for example, every two pixels — this represents the frequency. In the Fourier transform lower frequencies are closer to the center and higher frequencies are at the edges (the maximum frequency for an image is at the very edge). The location of Fourier transform values with high intensity (white in the images) are ordered according to the direction of the greatest change in intensity in the original image. This is very apparent from the next image and its log Fourier transforms (applying the log to the real values decreases the differences in pixel intensity in the image — we see information more easily this way).</p>
<figure id="attachment_214" aria-describedby="caption-attachment-214" style="width: 700px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_direction_detection.png?ssl=1"><img data-attachment-id="214" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/fourier_direction_detection/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_direction_detection.png?fit=1162%2C1039&amp;ssl=1" data-orig-size="1162,1039" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="fourier_direction_detection" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_direction_detection.png?fit=300%2C268&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_direction_detection.png?fit=1024%2C916&amp;ssl=1" class="wp-image-214 size-large" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/fourier_direction_detection.png?resize=700%2C626&#038;ssl=1" alt="fourier_direction_detection" width="700" height="626" data-recalc-dims="1" /></a><figcaption id="caption-attachment-214" class="wp-caption-text">Images by <a href="#fisher1998">Fisher &amp; Koryllos (1998)</a>. <a href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm">Source</a></figcaption></figure>
<p style="text-align: justify;">We immediately see that a Fourier transform contains a lot of information about the orientation of an object in an image. If an object is turned by, say, 37% degrees, it is difficult to tell that from the original pixel information, but very clear from the Fourier transformed values.</p>
<p style="text-align: justify;">This is an important insight: Due to the convolution theorem, we can imagine that convolutional nets operate on images in the Fourier domain and from the images above we now know that images in that domain contain a lot of information about orientation. Thus convolutional nets should be better than traditional algorithms when it comes to rotated images and this is indeed the case (although convolutional nets are still very bad at this when we compare them to human vision).</p>
<h3>Frequency filtering and convolution</h3>
<p style="text-align: justify;">The reason why the convolution operation is often described as a filtering operation, and why convolution kernels are often named filters will be apparent from the next example, which is very close to convolution.</p>
<figure id="attachment_274" aria-describedby="caption-attachment-274" style="width: 1061px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/filtered-image1.png?ssl=1"><img data-attachment-id="274" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/filtered-image/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/filtered-image1.png?fit=1061%2C287&amp;ssl=1" data-orig-size="1061,287" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="filtered image" data-image-description="" data-image-caption="&lt;p&gt;Images by &lt;a href=&quot;#fisher1998&quot;&gt;Fisher &amp;amp; Koryllos (1998)&lt;/a&gt;. &lt;a href=&quot;http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/filtered-image1.png?fit=300%2C81&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/filtered-image1.png?fit=1024%2C277&amp;ssl=1" class="wp-image-274 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/filtered-image1.png?resize=1061%2C287&#038;ssl=1" alt="" width="1061" height="287" data-recalc-dims="1" /></a><figcaption id="caption-attachment-274" class="wp-caption-text">Images by <a href="#fisher1998">Fisher &amp; Koryllos (1998)</a>. <a href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm">Source</a></figcaption></figure>
<p style="text-align: justify;">If we transform the original image with a Fourier transform and then multiply it by a circle padded by zeros (zeros=black) in the Fourier domain, we filter out all high frequency values (they will be set to zero, due to the zero padded values). Note that the filtered image still has the same striped pattern, but its quality is much worse now — this is how jpeg compression works (although a different but similar transform is used), we transform the image, keep only certain frequencies and transform back to the spatial image domain; the compression ratio would be the size of the black area to the size of the circle in this example.</p>
<p style="text-align: justify;">If we now imagine that the circle is a convolution kernel, then we have fully fledged convolution — just as in convolutional nets. There are still many tricks to speed up and stabilize the computation of convolutions with Fourier transforms, but this is the basic principle how it is done.</p>
<p style="text-align: justify;">Now that we have established the meaning of the convolution theorem and Fourier transforms, we can now apply this understanding to different fields in science and enhance our interpretation of convolution in deep learning.</p>
<h3 style="text-align: justify;">Insights from fluid mechanics</h3>
<p style="text-align: justify;">Fluid mechanics concerns itself with the creation of differential equation models for flows of fluids like air and water (air flows around an airplane; water flows around suspended parts of a bridge). Fourier transforms not only simplify convolution, but also differentiation, and this is why Fourier transforms are widely used in the field of fluid mechanics, or any field with differential equations for that matter.  Sometimes the only way to find an analytic solution to a fluid flow problem is to simplify a partial differential equation with a Fourier transform. In this process we can sometimes rewrite the solution of such a partial differential equation in terms of a convolution of two functions which then allows for very easy interpretation of the solution. This is the case for the diffusion equation in one dimension, and for some two dimensional diffusion processes for functions in cylindrical or spherical polar coordinates.</p>
<h3 style="text-align: justify;">Diffusion</h3>
<p style="text-align: justify;">You can mix two fluids (milk and coffee) by moving the fluid with an outside force (mixing with a spoon) — this is called convection and is usually very fast. But you could also wait and the two fluids would mix themselves on their own (if it is chemically possible)  — this is called diffusion and is usually a very slow when compared to convection.</p>
<p style="text-align: justify;">Imagine an aquarium that is split into two by a thin, removable barrier where one side of the aquarium is filled with salt water, and the other side with fresh water. If you now remove the thin barrier carefully, the two fluids will mix together until the whole aquarium has the same concentration of salt everywhere. This process is more “violent” the greater the difference in saltiness between the fresh water and salt water.</p>
<p style="text-align: justify;">Now imagine you have a square aquarium with 256&#215;256 thin barriers that separate 256&#215;256 cubes each with different salt concentration. If you remove the barrier now, there will be little mixing between two cubes with little difference in salt concentration, but rapid mixing between two cubes with very different salt concentrations. Now imagine that the 256&#215;256 grid is an image, the cubes are pixels, and the salt concentration is the intensity of each pixel. Instead of diffusion of salt concentrations we now have diffusion of pixel information.</p>
<p style="text-align: justify;">It turns out, this is exactly one part of the convolution for the diffusion equation solution: One part is simply the initial concentrations of a certain fluid in a certain area — or in image terms — the initial image with its initial pixel intensities. To complete the interpretation of convolution as a diffusion process we need to interpret the second part of the solution to the diffusion equation: The propagator.</p>
<h3 style="text-align: justify;">Interpreting the propagator</h3>
<p style="text-align: justify;">The propagator is a probability density function, which denotes into which direction fluid particles diffuse over time. The problem here is that we do not have a probability function in deep learning, but a convolution kernel — how can we unify these concepts?</p>
<p style="text-align: justify;">We can apply a normalization that turns the convolution kernel into a probability density function. This is just like computing the softmax for output values in a classification tasks. Here the softmax normalization for the edge detector kernel from the first example above.</p>
<figure id="attachment_217" aria-describedby="caption-attachment-217" style="width: 762px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax.png?ssl=1"><img data-attachment-id="217" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/softmax/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax.png?fit=762%2C133&amp;ssl=1" data-orig-size="762,133" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="edge_detector_softmax" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax.png?fit=300%2C52&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax.png?fit=762%2C133&amp;ssl=1" class="wp-image-217 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax.png?resize=762%2C133&#038;ssl=1" alt="softmax" width="762" height="133" data-recalc-dims="1" /></a><figcaption id="caption-attachment-217" class="wp-caption-text"><strong>Softmax of an edge detector:</strong> To calculate the softmax normalization, we taking each value <img src="https://s0.wp.com/latex.php?latex=%7Bx%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{x}" class="latex" /> of the kernel and apply <img src="https://s0.wp.com/latex.php?latex=%7Be%5Ex%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{e^x}" class="latex" />. After that we divide by the sum of all <img src="https://s0.wp.com/latex.php?latex=%7Be%5Ex%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{e^x}" class="latex" />. Please note that this technique to calculate the softmax will be fine for most convolution kernels, but for more complex data the computation is a bit different to ensure numerical stability (floating point computation is inherently unstable for very large and very small values and you have to carefully navigate around troubles in this case).</figcaption></figure>
<p style="text-align: justify;">Now we have a full interpretation of convolution on images in terms of diffusion. We can imagine the operation of convolution as a two part diffusion process: Firstly, there is strong diffusion where pixel intensities change (from black to white, or from yellow to blue, etc.) and secondly, the diffusion process in an area is regulated by the probability distribution of the convolution kernel. That means that each pixel in the kernel area, diffuses into another position within the kernel according to the kernel probability density.</p>
<p style="text-align: justify;">For the edge detector above almost all information in the surrounding area will concentrate in a single space (this is unnatural for diffusion in fluids, but this interpretation is mathematically correct). For example all pixels that are under the 0.0001 values, will very likely flow into the center pixel and accumulate there. The final concentration will be largest where the largest differences between neighboring pixels are, because here the diffusion process is most marked. In turn, the greatest differences in neighboring pixels is there, where the edges between different objects are, so this explains why the kernel above is an edge detector.</p>
<p style="text-align: justify;">So there we have it: Convolution as diffusion of information. We can apply this interpretation directly on other kernels. Sometimes we have to apply a softmax normalization for interpretation, but generally the numbers in itself say a lot about what will happen. Take the following kernel for example. Can you now interpret what that kernel is doing? <a href="#quiz">Click here</a> <a id="continue"></a>to find the solution (there is a link back to this position).</p>
<p style="text-align: justify;"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax_quiz.png?ssl=1"><img data-attachment-id="220" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/softmax_quiz/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax_quiz.png?fit=725%2C134&amp;ssl=1" data-orig-size="725,134" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="softmax_gaussian_kernel" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax_quiz.png?fit=300%2C55&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax_quiz.png?fit=725%2C134&amp;ssl=1" class="aligncenter size-full wp-image-220" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/softmax_quiz.png?resize=660%2C122&#038;ssl=1" alt="softmax_quiz" width="660" height="122" data-recalc-dims="1" /></a></p>
<h3 style="text-align: justify;">Wait, there is something fishy here</h3>
<p style="text-align: justify;">How come that we have deterministic behavior if we have a convolution kernel with probabilities? We have to interpret that single particles diffuse according to the probability distribution of the kernel, according to the propagator, don’t we?</p>
<p style="text-align: justify;">Yes, this is indeed true. However, if you take a tiny piece of fluid, say a tiny drop of water, you still have millions of water molecules in that tiny drop of water, and while a single molecule behaves stochastically according to the probability distribution of the propagator, a whole bunch of molecules have quasi deterministic behavior —this is an important interpretation from statistical mechanics and thus also for diffusion in fluid mechanics. We can interpret the probabilities of the propagator as the average distribution of information or pixel intensities;  Thus our interpretation is correct from a viewpoint of fluid mechanics. However, there is also a valid stochastic interpretation for convolution.</p>
<h3 style="text-align: justify;">Insights from quantum mechanics</h3>
<p style="text-align: justify;">The propagator is an important concept in quantum mechanics. In quantum mechanics a particle can be in a superposition where it has two or more properties which usually exclude themselves in our empirical world: For example, in quantum mechanics a particle can be at two places at the same time —  that is a single object in two places.</p>
<p style="text-align: justify;">However, when you measure the state of the particle — for example where the particle is right now — it will be either at one place or the other. In other terms, you destroy the superposition state by observation of the particle. The propagator then describes the probability distribution where you can expect the particle to be. So after measurement a particle might be — according to the probability distribution of the propagator — with 30% probability in place A and 70% probability in place B.</p>
<p style="text-align: justify;">If we have entangled particles (spooky action at a distance), a few particles can hold hundreds or even millions of different states at the same time — this is the power promised by quantum computers.</p>
<p style="text-align: justify;">So if we use this interpretation for deep learning, we can think that the pixels in an image are in a superposition state, so that in each image patch, each pixel is in 9 positions at the same time (if our kernel is 3&#215;3). Once we apply the convolution we make a measurement and the superposition of each pixel collapses into a single position as described by the probability distribution of the convolution kernel, or in other words: For each pixel, we choose one pixel of the 9 pixels at random (with the probability of the kernel) and the resulting pixel is the average of all these pixels. For this interpretation to be true, this needs to be a true stochastic process, which means, the same image and the same kernel will generally yield different results. This interpretation does not relate one to one to convolution but it might give you ideas how to the apply convolution in stochastic ways or how to develop quantum algorithms for convolutional nets. A quantum algorithm would be able to calculate <em>all</em> possible combinations described by the kernel with <em>one</em> computation and in <em>linear</em> time/qubits with respect to the size of image and kernel.</p>
<h3 style="text-align: justify;">Insights from probability theory</h3>
<p style="text-align: justify;">Convolution is closely related to cross-correlation. Cross-correlation is an operation which takes a small piece of information (a few seconds of a song) to filter a large piece of information (the whole song) for similarity (similar techniques are used on youtube to automatically tag videos for copyrights infringements).</p>
<figure id="attachment_301" aria-describedby="caption-attachment-301" style="width: 700px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cross-correlation2.png?ssl=1"><img data-attachment-id="301" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/cross-correlation/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cross-correlation2.png?fit=1490%2C460&amp;ssl=1" data-orig-size="1490,460" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="cross-correlation" data-image-description="" data-image-caption="&lt;p&gt;&lt;strong&gt;Relation between cross-correlation and convolution:&lt;/strong&gt; Here $latex {star}&amp;amp;bg=ffffff$ denotes cross correlation and $latex {f^*}&amp;amp;bg=ffffff$ denotes the &lt;a title=&quot;wiki&quot; href=&quot;http://en.wikipedia.org/wiki/Complex_conjugate&quot;&gt;complex conjugate &lt;/a&gt;of $latex {f}&amp;amp;bg=ffffff$.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cross-correlation2.png?fit=300%2C93&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cross-correlation2.png?fit=1024%2C316&amp;ssl=1" class="wp-image-301 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cross-correlation2.png?resize=700%2C216&#038;ssl=1" alt="" width="700" height="216" data-recalc-dims="1" /></a><figcaption id="caption-attachment-301" class="wp-caption-text"><strong>Relation between cross-correlation and convolution:</strong> Here <img src="https://s0.wp.com/latex.php?latex=%7B%5Cstar%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{&#92;star}" class="latex" /> denotes cross correlation and <img src="https://s0.wp.com/latex.php?latex=%7Bf%5E%2A%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{f^*}" class="latex" /> denotes the complex conjugate of <img src="https://s0.wp.com/latex.php?latex=%7Bf%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{f}" class="latex" />.</figcaption></figure>
<p style="text-align: justify;">While cross correlation seems unwieldy, there is a trick with which we can easily relate it to convolution in deep learning: For images we can simply turn the search image upside down to perform cross-correlation through convolution. When we perform convolution of an image of a person with an upside image of a face, then the result will be an image with one or multiple bright pixels at the location where the face was matched with the person.</p>
<figure id="attachment_228" aria-describedby="caption-attachment-228" style="width: 611px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/crosscorrelation_example.png?ssl=1"><img data-attachment-id="228" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/crosscorrelation_example/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/crosscorrelation_example.png?fit=611%2C232&amp;ssl=1" data-orig-size="611,232" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="cross_correlation_through_convolution" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/crosscorrelation_example.png?fit=300%2C114&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/crosscorrelation_example.png?fit=611%2C232&amp;ssl=1" class="wp-image-228 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/crosscorrelation_example.png?resize=611%2C232&#038;ssl=1" alt="crosscorrelation_Example" width="611" height="232" data-recalc-dims="1" /></a><figcaption id="caption-attachment-228" class="wp-caption-text"><strong>Cross-correlation via convolution:</strong> The input and kernel are padded with zeros and the kernel is rotated by 180 degrees. The white spot marks the area with the strongest pixel-wise correlation between image and kernel. Note that the output image is in the spatial domain, the inverse Fourier transform was already applied. Images taken from <a href="http://www.dspguide.com/swsmith.htm">Steven Smith&#8217;</a>s excellent free <a href="http://www.dspguide.com/pdfbook.htm">online book</a> about digital signal processing.</figcaption></figure>
<p style="text-align: justify;">This example also illustrates padding with zeros to stabilize the Fourier transform and this is required in many version of Fourier transforms. There are versions which require different padding schemes: Some implementation warp the kernel around itself and require only padding for the kernel, and yet other implementations perform divide-and-conquer steps and require no padding at all. I will not expand on this; the literature on Fourier transforms is vast and there are many tricks to be learned to make it run better — especially for images.</p>
<p style="text-align: justify;">At lower levels, convolutional nets will not perform cross correlation, because we know that they perform edge detection in the very first convolutional layers. But in later layers, where more abstract features are generated, it is possible that a convolutional net learns to perform cross-correlation by convolution. It is imaginable that the bright pixels from the cross-correlation will be redirected to units which detect faces (the Google brain project has some units in its architecture which are dedicated to faces, cats etc.; maybe cross correlation plays a role here?).</p>
<h3 style="text-align: justify;">Insights from statistics</h3>
<p style="text-align: justify;">What is the difference between statistical models and machine learning models? Statistical models often concentrate on very few variables which can be easily interpreted. Statistical models are built to answer questions: Is drug A better than drug B?</p>
<p style="text-align: justify;">Machine learning models are about predictive performance: Drug A increases successful outcomes by 17.83% with respect to drug B for people with age X, but 22.34% for people with age Y.</p>
<p style="text-align: justify;">Machine learning models are often much more powerful for prediction than statistical models, but they are not reliable. Statistical models are important to reach accurate and reliable conclusions:  Even when drug A is 17.83% better than drug B, we do not know if this might be due to chance or not; we need statistical models to determine this.</p>
<p style="text-align: justify;">Two important statistical models for time series data are the weighted moving average and the autoregressive models which can be combined into the ARIMA model (autoregressive integrated moving average model). ARIMA models are rather weak when compared to models like long short-term recurrent neural networks, but ARIMA models are extremely robust when you have low dimensional data (1-5 dimensions). Although their interpretation is often effortful, ARIMA models are not a blackbox like deep learning algorithms and this is a great advantage if you need very reliable models.</p>
<p style="text-align: justify;">It turns out that we can rewrite these models as convolutions and thus we can show that convolutions in deep learning can be interpreted as functions which produce local ARIMA features which are then passed to the next layer. This idea however, does not overlap fully, and so we must be cautious and see when we really can apply this idea.</p>
<p><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoregression_weighted_average.png?ssl=1"><img data-attachment-id="267" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/autoregression_weighted_average/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoregression_weighted_average.png?fit=1111%2C171&amp;ssl=1" data-orig-size="1111,171" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="autoregression_weighted_average" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoregression_weighted_average.png?fit=300%2C46&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoregression_weighted_average.png?fit=1024%2C158&amp;ssl=1" class="aligncenter size-full wp-image-267" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/autoregression_weighted_average.png?resize=700%2C108&#038;ssl=1" alt="autoregression_weighted_average" width="700" height="108" data-recalc-dims="1" /></a></p>
<p style="text-align: justify;">Here <img src="https://s0.wp.com/latex.php?latex=%7BC%28%5Cmbox%7Bkernel%7D%29%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{C(&#92;mbox{kernel})}" class="latex" /> is a constant function which takes the kernel as parameter; white noise is data with mean zero, a standard deviation of one, and each variable is uncorrelated with respect to the other variables.</p>
<p style="text-align: justify;">When we pre-process data we make it often very similar to white noise: We often center it around zero and set the variance/standard deviation to one. Creating uncorrelated variables is less often used because it is computationally intensive, however, conceptually it is straight forward: We reorient the axes along the eigenvectors of the data.</p>
<figure id="attachment_272" aria-describedby="caption-attachment-272" style="width: 522px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/eigenvector_decorrelation1.png?ssl=1"><img data-attachment-id="272" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/eigenvector_decorrelation/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/eigenvector_decorrelation1.png?fit=522%2C500&amp;ssl=1" data-orig-size="522,500" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="eigenvector_decorrelation" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/eigenvector_decorrelation1.png?fit=300%2C287&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/eigenvector_decorrelation1.png?fit=522%2C500&amp;ssl=1" class="wp-image-272 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/eigenvector_decorrelation1.png?resize=522%2C500&#038;ssl=1" alt="eigenvector_decorrelation" width="522" height="500" data-recalc-dims="1" /></a><figcaption id="caption-attachment-272" class="wp-caption-text"><strong>Decorrelation by reorientation along eigenvectors:</strong> The eigenvectors of this data are represented by the arrows. If we want to decorrelate the data, we reorient the axes to have the same direction as the eigenvectors. This technique is also used in PCA, where the dimensions with the least variance (shortest eigenvectors) are dropped after reorientation.</figcaption></figure>
<p style="text-align: justify;">Now, if we take <img src="https://s0.wp.com/latex.php?latex=%7BC%28%5Cmbox%7Bkernel%7D%29%7D&#038;bg=ffffff&#038;fg=000&#038;s=0&#038;c=20201002" alt="{C(&#92;mbox{kernel})}" class="latex" /> to be the bias, then we have an expression that is very similar to a convolution in deep learning. So the outputs from a convolutional layer can be interpreted as outputs from an autoregressive model if we pre-process the data to be white noise.</p>
<p style="text-align: justify;">The interpretation of the weighted moving average is simple: It is just standard convolution on some data (input) with a certain weight (kernel). This interpretation becomes clearer when we look at the Gaussian smoothing kernel at the end of the page. The Gaussian smoothing kernel can be interpreted as a weighted average of the pixels in each pixel&#8217;s neighborhood, or in other words, the pixels are averaged in their neighborhood (pixels &#8220;blend in&#8221;, edges are smoothed).</p>
<p style="text-align: justify;">While a single kernel cannot create both, autoregressive and weighted moving average features, we usually have multiple kernels and in combination all these kernels might contain some features which are like a weighted moving average model and some which are like an autoregressive model.</p>
<h3 style="text-align: justify;">Conclusion</h3>
<p style="text-align: justify;">In this blog post we have seen what convolution is all about and why it is so powerful in deep learning. The interpretation of image patches is easy to understand and easy to compute but it has many conceptual limitations. We developed convolutions by Fourier transforms and saw that Fourier transforms contain a lot of information about orientation of an image. <a id="quiz"></a>With the powerful convolution theorem we then developed an interpretation of convolution as the diffusion of information across pixels. We then extended the concept of the propagator in the view of quantum mechanics to receive a stochastic interpretation of the usually deterministic process. We showed that cross-correlation is very similar to convolution and that the performance of convolutional nets may depend on the correlation between feature maps which is induced through convolution. Finally, we finished with relating convolution to autoregressive and moving average models.</p>
<p style="text-align: justify;">Personally, I found it very interesting to work on this blog post. I felt for long time that my undergraduate studies in mathematics and statistics were wasted somehow, because they were so unpractical (even though I study <em>applied</em> math). But later — like an emergent property — all these thoughts linked together and practically useful understanding emerged. I think this is a great example why one should be patient and carefully study all university courses — even if they seem useless at first.</p>
<figure id="attachment_219" aria-describedby="caption-attachment-219" style="width: 499px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution_quiz.png?ssl=1"><img data-attachment-id="219" data-permalink="https://timdettmers.com/2015/03/26/convolution-deep-learning/convolution_quiz/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution_quiz.png?fit=388%2C150&amp;ssl=1" data-orig-size="388,150" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="gaussian_smoothing" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution_quiz.png?fit=300%2C116&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution_quiz.png?fit=388%2C150&amp;ssl=1" class="wp-image-219" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/convolution_quiz.png?resize=499%2C193&#038;ssl=1" alt="convolution_quiz" width="499" height="193" data-recalc-dims="1" /></a><figcaption id="caption-attachment-219" class="wp-caption-text"><strong>Solution to the quiz above:</strong> The information diffuses nearly equally among all pixels; and this process will be stronger for neighboring pixels that differ more. This means that sharp edges will be smoothed out and information that is in one pixel, will diffuse and mix slightly with surrounding pixels. This kernel is known as a Gaussian blur or as Gaussian smoothing. <a href="#continue">Continue reading</a>. Sources: <a href="https://en.wikipedia.org/wiki/File:Vd-Orig.png">1</a> <a href="https://en.wikipedia.org/wiki/File:Vd-Blur1.png">2</a></figcaption></figure>
<p><strong>Image source reference</strong></p>
<p><a id="fisher1998"></a>R. B. Fisher, K. Koryllos, &#8220;Interactive Textbooks; Embedding Image Processing Operator Demonstrations in Text&#8221;, Int. J. of Pattern Recognition and Artificial Intelligence, Vol 12, No 8, pp 1095-1123, 1998.</p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2015/03/26/convolution-deep-learning/">Understanding Convolution in Deep Learning</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://timdettmers.com/2015/03/26/convolution-deep-learning/feed/</wfw:commentRss>
			<slash:comments>112</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">192</post-id>	</item>
	</channel>
</rss>
