VLSI Introduction:

VLSI: Very Large Scale Integration. This is the field of Electrical/Electronic Engineering that deals with the science of designing circuits and building them on chips.

There are many preliminary courses that you will need to take, before you can start designing chips.

Circuits are built using passive components: R, L, C.

On top of above 3, we have an active component known as "transistor" that brought about all the revolution in electronics. Transistor is basically an "electronic switch" that you can turn ON or OFF using voltage signal (by contrast, a manual switch at home requires physical force to turn it on or off). When we talk about VLSI or solid state, we are almost exclusively talking about transistors. Transistors are what made all modern chips possible, so it's one of the greatest invention that gave us all modern electronics today.

VLSI History:

Since 1950's, all these passive elements used to be stand alone devices. They were big, and to make any circuit out of them required considerable space. Then came active element, transistors. Transistors used to be stand alone devices too, similar to Resistors and capacitors. However, researchers started looking into ways of making these transistors smaller and getting a lot of them to be etched out on a single base. Silicon became a compound of choice. This gave birth to LSI in 1950's.  With advent of LSI, we started building transistors on Silicon wafers and integrating a lot of them on the same silicon wafer. This greatly reduced the size of each transistors and allowed thousands of transistors to be put together close to each other connected by miniature wires which were themselves etched on silicon. The number of transistors being etched on a single wafer kept on increasing which gave birth to VLSI.The process of etching patterns on silicon to make working chips is extremely complicated, and to make it work with billions of transistors on it is just MAGIC !!

A very good history of VLSI and how small the dimensions of these transistor were in each technology can be found on this link:

https://en.wikichip.org/wiki/technology_node

Silicon (also called Polysilicon in VLSI world): Leading-edge semiconductor-grade polysilicon must be purified to “eleven nines” (99.999999999 per cent), which only a handful of specialized companies—based in Michigan, Germany, and Japan—are poised to do. These silicon chunks are melted in bespoke crucibles made of the world’s purest quartz, virtually all of which is mined from a solitary deposit in the mountains of North Carolina. This process, which generates perfectly crystalline silicon ingots to be sliced like fragile metallic salamis into thin wafers, is entrusted largely to one firm in Taiwan and two in Japan.

FEOL vs BEOL:

FEOL (Front End of Line) refers to steps associated with transistor fabrication. Transistor fabrication on silicon involves 10-50 steps for modern CMOS tech. It needs the most advanced and cutting edge tools and tech to build the smallest transistors. It takes 30 days or more to complete all fab steps associated with a transistor and get it out. Photomasks for transistors are also the most expensive ones, as they need to have very high accuracy for the small size of the transistors.

BEOL (Back End of Line) refers to steps associated after the transistors layers are done. This is where interconnects to transistors are built using metal layers. Fabricating these metal layers isn't as complex as fabricating the transistors. Once transistor layers are deposited properly and transistors are functioning, building metal layers on top of it goes faster. It's 2 masks for each metal layer (one for horizontal connection and other for vertical cuts to connect one layer to another). These masks are cheaper as the width of metal layers isn't as small as transistor gate length. Each metal layer takes a day to go thru the fab, so 10 metal layers will take about 10 days. As FEOL dimensions shrink, BEOL dimensions also need to shrink, so that the overall gain in density can be achieved.

Full node (FN) vs Half node (HN):

Transistors size can get reduced by any amount from one node to other. However, it would be very expensive to introduce a new node just for little bit of size reduction. Reason is that size reduction of transistors usually imply that associated tools used in Fab have to be changed to design with lower transistor size, which is very costly. A rule that has been followed in Semiconductor fabrication is that a transistor reduction that would give 2X the transistors density is worth the cost. The lower size of chip due to 2X the density implies chip cost has been cut into half, which is able to absorb the extra cost of fab retooling. To get to 2X density, both X and Y dimension of chip has to decrease by 0.7X (since 0.7X * 0.7y = 0.5xy => half the size of original chip). So, we not only reduce the length of transistor by 0.7X, but we also decrease the width of transistor by 0.7X. This is known as a full node.So going from 1um node to 0.um node is a full node transition which is very costly. Full node transistion has been happening every 2 years, implying transistor density is doubling every 2 years. This is also known as Gordon Moore's Law, who famously predicted this in 1965. However, companied don't want to sit idle for 2 full years, without showing any improvement. To address this, these chip companies introduced a half node. Half node is a 10% reduction in size of transistors in fab without changing the tools completely. Design was done in such a way that existing design could be used, and reduction in size was done entirely in fab. This gave some incremental improvement without redesigning the circuit or re-tooling the fab. This came to be known as half node and came in between 2 full nodes. So, a half node would give 20% (since 0.9X * 0.9y = 0.8xy) reduction in IC size, while full node would give 50% reduction in size.

Every 4 years, we would get transistor length reduction to be 1/2 of it's current one (since every 2 years, it goes down by 0.7X, so every 4 years it's 0.7*0.7=0.49 or almost half). That is why FN tech goes like this 1um -> 500nm ->  250nm -> 130nm -> 65nm -> 32nm -> 16nm -> 7nm -> 3nm, and so on.

Tech Node:

A technology node of certian um or nm usually refers to the smallest dimension that can be etched out on the silicon. Usually it's the gate length of the transistor that has the smallest dimension. Also, the gate length of a transistor has inverse relationship to the performance, as shorter transistor length implies a higher current, and hence faster speed. Since the transistors were invented, tech nodes referred to transistor length (so a 2um node meant that the transistors on this node have 2um gate length with slight variations. You can't etch out a gate with length < 2um on this node). Along with this we also got a 2X increase in density with every full node. But as we got to smaller transistor lengths, it was observed that just reducing transistor gate length didn't guarantee a 2X increase in density. It was limited by how much closer you could place transistors to each other. If you couldn't scale that distance to half every 2 years, you wouldn't get to 2X scaling. So, 2X density improvement became the new definition for defining a full node. The nm or um number for tech node that used to refer to gate length didn't necessarily refer to gate length anymore, though it's close. Some people starting calling the half pitch as the better  definition for a tech node. Pitch is defined as the distance between 2 adjacent gates. Min pitch refers to the closest you can get 2 gates to each other while still having space to make contacts to both the gates and the active source/drain regions. Half pitch is half of this distance, and turns out that half pitch is a very relevant number when talking about density improvement. So, a lot of later tech nodes since 2000 use their tech node "nm" to refer to the "half pitch" or "gate length" or to something smaller than both of these. That "nm" number is more of a marketing ploy now. So, keep that in mind when going thru the tech nodes below.

Tech node timeframe is as below. I'm showing full node process only.

  • 50um - 10um => 50um was the first process developed in mid 1960's for building transistors on wafers. The typical wafer size (diameter) was < 1 inch (only 22mm). 50um is the typical thickness of human hair (100um is 1/10th of a mm), so transistors of this size could possibly be seen by naked human eyes (though microscope will be necessary as these 50um lines will be very close to each other and hence difficult to distinguish). Going from 50um to 10um, wafer size increased to 2 inch. 10um was being developed actively during early 1970's. Intel' 8008 was developed on 10um tech.
  • 10um - 1um => From mid 1970's to late 1980's, transistor size kept on decreasing, while wafer size kept on increasing (from 1 inch all the way to 6 inch or 150mm), resulting in even greater transistors per wafer. Bulk CMOS tech was being used with voltages at 5V. Only one metal layer was being used for interconnect, though 2 metal layers started getting used for 2um or below.. Intel's 8086 series was being developed during this time using 1 tech nodes close to 1um.
  • 1 um => introduced in late 1980's. Intel's 80386 and 80486 were based off this. 1um tech was big step, as transistors of this size were considered infeasible just a decade or two back.
  • 700 nm => Introduced in early 1990's, it was a full node followup to 1um tech. 3 metal layers were being used here. Intel's Pentium Pro was built on this process node.
  • 500 nm => Commercial ICs started getting produced using 0.5um tech in 1993. It was called a half micron process. 4 metal layers of Al-Cu (Aluminum Copper) started getting used. Oxide thickness was reduced to about 10nm. The process typically had a Threshold voltage of 0.5V and a supply voltage of 3.3 V.
  • 350 nm => Commercial production using 350nm started in late 1995. Number of metal layers went to 5 with oxide thickness further reduced to 6nm. Intel's Pentium and Pentium II were built on this.
  • 250 nm => Also known as "quarter micron" process,  Intel along with other leading semiC companies entered 0.25um process in 1997. Intel's process used 200 mm wafers, SiO2 dielectric and polysilicon electrodes. It used Aluminum inter-connects. Intel also made a smaller chip using 5% shrink to original design rules which used. Gate pitch and interconnect pitch was about 500nm-700nm. 
  • 180 nm => This was introduced in 1999 by Intel, TI, IBM and TSMC. Number of metal layers went to 7. Gate pitch and interconnect pitch was about 450nm-500nm. 
  • 130 nm => This was introduced in 2001 by Intel, TI, IBM and TSMC. Number of metal layers went to 8. Gate pitch and interconnect pitch was about 350nm. SOI process instead of Bulk started getting used at AMD, IBM, etc which was basically silicon on insulator which allowed the body to float instead of being tied to power supply as in bulk tech.
  • 90 nm => This was introduced in 2003. Gate pitch and interconnect pitch was about 250nm. At 90nm, 300 mm (12 inch) wafers started getting used, which was a big step from 200mm or 8 inch wafers that were being used before than.
  • 65 nm => This was introduced in 2006. Gate pitch and interconnect pitch was about 200nm. 
  • 45 nm => Commercial manufacturing using 45 nm process began in 2007. Intel's 45 nm process was the first time high-k + metal gate transistors was used in high-volume manufacturing process. Before this, poly was being used for gate, which had very high resistivity. Gate pitch and interconnect pitch was about 160nm-180nm. 
  • 32nm => 32nm manufacturing began in 2010. Metal layers went to 9 to 11 layers. 193nm Immersion Lithography was being used for 32nm. Gate length was 30nm, even though node was 32nm. Gate pitch and interconnect pitch was about 100nm-130nm. Supply voltages came down to 1V or below for the first time. 28nm was a half node introduced a year later, and was a stop gap b/w 32nm and 22nm.
  • 22 nm => 22nm manufacturing for processors began in 2012, although memories were being built on this node since 2008. Until 22nm, we were using planar transistors that were conventional transistors that had been used since CMOS tech came into existence. However, it was becoming more difficult to scale planar transistors as sizes kept on shrinking. Companies were looking for alternatives. Fin based 3D transistors were actively being researched and showed promise. The 22 nm became Intel's first generation of Tri-gate FinFET transistors and the first such transistor on the market. Other companies didn't jump to FinFET bandwagon yet and continued with planar transistors. Intel's core i3, i5 and i7 were built on this new tech. Gate pitch and interconnect pitch was about 80nm-100nm. Supply voltages came further down to 0.7V-0.8V.  20nm was a half node introduced in 2014 followed by a 16nm Full Node in late 2015. 20nm was still in Planar technology while 16nm moved to FinFet.
  • 16nm / 14nm => 16nm was the first time industry moved away completely from Planar transistor to FinFet transistors. Things got more confusing as "nm" no longer referred to gate length, and different companies started adopting different naming convention as per their choice. There is also confusion as to whether 16nm or 14 nm is a full node. Based on Maths, looks like 15nm should be full node. Some companies went with 16nm as their full node, while others went with 14nm. Manufacturing using 16nm/14nm began in 2014/2015. Both 14nm and 16nm were still based on 193nm Immersion Lithography. Supply voltages were same around 0.7V.
    • 16nm: TSMC introduced their first 16nm FinFet process known as 16FF, followed by later revisions as shown below. Gate length was 34 nm (not 16nm), with Fin pitch at 48nm and Gate pitch at 90nm.
      • 16FF => 16nm FinFet process. It used the same 20nm BEOL.
      • 16FF+ => Improved 16nm FF process to give 10-15% perf improvement
      • 16FFC => 16nm FinFet Compact was the refined version of earlier process which reduced cost by using less masks, and used half the power.
    • 14nm: Intel introduced their 14nm process as P1272/P1273. Samsung introduced 14LPE (Low Power Early), 14LPP (Low Power Performance), 14LPC and 14LPU. IBM (Fabs were sold to Global Foundary in 2014) 14HP process started manufacturing a bit later in 2017. UMC also started mass manufacturing of their 14nm process in 2017.  All these had smaller gate length varying from 20nm-30nm (nowhere close to 14nm). Fin pitch was 42nm, while gate pitch was at 70nm-80nm. Minimum metal pitch was 50nm-60nm. Fin width was 8nm, with Fin height at 40nm. Intel 14nm process had further refinements with 14nm+, 14nm++ which yielded up to 50% less power and 30%-40% higher drive current. Intel's 14nm process was the densest, with 1.5X raw logic density when compared to other leading Fabs.
  • 14 nm =>
  • 10nm
  • 7nm
  • 5nm
  • 3nm
  • 2nm

 

Diff node Scaling:

Pitch (in nm)   N7 N5 N3 N2  A14  A10  A7  A5
                   
Poly Length (L)   11 nm  6 nm  3 nm  3 nm  3 nm (still 3nm in A14 layout)      
Cell Height   240 (4*M0 + VDD +VSS = 6*M0) 210 (5*M0 + VDD +VSS = 7*M0)  170 (5*M0 + VDD +VSS = 7*M0)          
Cell Width   3*CPP (1 extra CPP due to PODE dummy) 2*CPP  2*CPP          
 Cell Area (invX1)=H*W    0.24*0.16=0.038um^2  0.21*0.1=0.021um^2  0.17*0.1=0.017um^2  0.13*0.1=0.013um^2        
cell density (nd2x1/mm^2)   ~20M/mm^2 ~40M/mm^2            
CPP (poly pitch)   57 51  48          
M0 pitch (H)   P=40 (< CPP), W=30

P=28 (< CPP), W=28

(low pitch due to double patterning)

 P= ~24          
M1 pitch (V)   P=57 (= CPP), W=30 P=34 (< CPP), W=28            
M2 width (H)   W=40 W=35            
M3 (V)   44  42            
M4-M8   76 (~2X of min)  M4=44, rest=76            
M9-M10   126 (~4X of min) 76            
M11-M12   720 (~20X of min) 126            
M13-M14   N/A 720            
M14-M17    N/A  N/A            
M18-Mxx                  
                   

 

Layout of size D1 Inverter: This is the smallest area gate that can be made in any tech. D1 refers to Drive strength of 1, which is an arbitrary strength of smalled area inverter. We have inverters with drive strength D0.3, D0.5 or D0.7, but usually the area doesn't go any lower than that of D1, we we need a min of 2 Ploy pitch width i any std cell.

Max Poly width that we can fit in a smallest size D1 inverter is usually < 0.2*Height of the cell, as we need clearance of this poly diffusion from and top and bottom, and also separation b/w the 2  of the diffusion layers, one for PMOS and other for NMOS. Assuming all of these separations to be the same as poly width, the max poly width = Height/5. As we go to lower nodes, Max Poly width may not scale as fast as height, as there might be additional DRC rules that may prevent active regions from getting too packed. For tech node N7 where height=240nm, Max poly width = 38nm (0.16X). However for N3, where height=170nm, Max poly width = 32nm (0.19X).  

Min Poly width that we can put in a std cell is usually limited by litho process. We can ideally go as small as poly length, but that's not possible for active regions, as active regions are not uniformaly placed as a poly. The smallest W that I've seen is 2X of L. 

Poly pitch (PP) is usually > 10x of "L" of transistor. This is because we can't poly very close to each other due to lithography limitations. As we go to lower nodes, PP doesn't scale as fast as L.  So, if L goes to 0.5X going from one node to next, PP may only go down by 0.8X. So for tech node N5 where L=6nm, PP = 51nm (9X). However for N2, L=3nm, but PP=48nm (16X). 

Width/Height of D1 Inv: Size D1 transistor will have 2 PP width, so min width of cell=2*PP=2*(15*L)=30*L (for N3 and below). Min height of cell is dictated by pitch of M1 layer as well as how many of M1 layers are needed. Due to double patterning of metal layers in N5 and below, we are able to get pitch of M0 layers to be almost half of poly pitch, so total height = 7*M0_pitch=7*1/2*PP=3.5*(15*L)=50*L (for N3 and below). 

Area of Stdcell: So based on W/H of cell, we can estimate the area of size D1 of inverter, as W*H=(30*L)*(50*L)=1500*L^2. For L=3nm, we get 1500*(0.003)^2 = 0.01um^2, which is very close to what we see in N3 tech. Area of a latch (size D1) is usually 5X the area of Inv D1, while the area of flop is usually 2X the area of latch as flop is essentially 2 latches connected back to back as master and slave.

 

VLSI Topics:

This is the sequence of topics we'll cover in VLSI section:

1. R, L, C: A lot of simple circuits may be made using R,L and C. These are simple to understand.

2. Solid state devices: Transistors, diodes. These are more difficult to understand.

3. Digital Library cells:

4. Digital Hardware language:

5. CAD tools

6. Analog design

7.

Links:

1. Sunburst: One of the best places to learn digital vlsi design: http://www.sunburst-design.com/

Here they offer a lot of paid training. You don't need to take any paid courses. They do have a lot of free papers, that have a lot of useful info. http://www.sunburst-design.com/papers/

I'll list these papers in different section as we talk about the various topics.

2. Teamvlsi: I saw a few good topics covered here. They also have a youtube channel with good videos. Link: https://teamvlsi.com

3.

 

Restaurants:

This section includes all restaurants chains where you can get food for decent price. As of 2022, prices are going up for all restaurants, so pricing may be outdated. Below are some of the chains that provide value for your money. If you are looking for fast food options, please check in "fast food" section.

 

Olive Garden:

This is a chain. Good Italian food for a very reasonable price. They are not a fast food, but look like high end restaurant with meals being served at table. All their entrees include unlimited soup, salad and bread sticks. This itself is worth $5 or more. Then their luch entrees are $8 and regular entrees are $15. Quantity is good enough for 2 people. Many times you can find their gift cards on sale ($40 for a $50 GC).

Few vegetarian dishes here that I like:

  1. Eggplant parmasino => This is a favorite among veggie Indians. It has eggplant stuffed with things, tastes nice.
  2. Stuffed Fettuccine Alfredo: This is a nice option. It's stuffed with cheese.
  3. Five Cheese Ziti al Forno => I don't remeber4 how it tasted. Will update it later?

Here's a link from slickdeals with various options to try: https://daily.slickdeals.net/food/olive-garden-special-meal-deals/

  • Monday-Friday lunch specials for $8-$10. Includes unlimited soup and salad.
  • For every dine in entree, you can get to take home an entree for $5 more. There are 3 options for take home entree = Fettuccine Alfredo, Five Cheese Ziti al Forno and Spaghetti with Meat Sauce. Lunch specials don't qualify for the take home.

 

 


 

DEALS:

 

All Gift Card deals for fast food are in gift card section. Consider buying those GC where possible and then get these deals.

 

2023:

 

 


 

09/27/23: Olive Garden - Unlimited Pasta for $14 - limited time:

Good offer that comes once in a while: https://slickdeals.net/f/16947016-olive-garden-never-ending-pasta-bowl-w-soup-salad-and-breadsticks-14-dine-in-only-at-participating-locations

 

Semiconductor Memory:

Processor and Memory are 2 most important components of any digital chip. Just as transistors are used to build logic functionality on a chip (such as AND, OR gates to buld a adder, etc), the same transistors are used to serve as memory to store bits. Memory can store bit 0 (voltage=0 Volts) and bit 1 (voltage=VDD Volts)

There are 2 kinds of memory:

1. Volatile Memory:

These are the memories that lose their contents when power is turned off. In your laptop, you have a hard drive, which is non volatile memory. It keeps the contents even when power is turned off. The CPU transfers programs from hard drive to a volatile memory, and accesses it from there. That makes the programs run faster, as there is significantly lower delay accessing contents from this faster volatile memory. There are 2 kinds of Volatile memories: 

A. SRAM (static random access memory):  This is usually seen on a processor, integrated with other logic. Any circuit that has 2 back to back inverters can serve as a memory. So, we could use flops, latches, etc to serve as memory. However, flops and latches have large number of gates (usually 8 or more gates), which is very costly in terms of area. Early on, engineers started making custom version of these latches so that can be put together closeer and need fewer transistors. They came with idea of using 6 transistors to make a memory cell (very similar to latch but with less transistors). Also, they reduced the size of transistor, and optimized the layout and decode logic, to start building compact memory modules. This memory is called 6T SRAM and is used in all logic chips to make register file, caches, etc. Tese memory are fast, but costly in terms of area, so they are usually limited in size to 64MB or so. They are used in caches and other memories on microprocessors. These are not sold as stand alone memories.

B. DRAM (dynamic random access memory):  This is the memory that is usually built and sold separately. It's not integrated in the processor, but sits right next to the processor. This is slower than SRAM, as it's sitting further away, and has lot more stuff packed. However, it requires only 1 transistor and one capacitor to build 1 memory cell. This makes it much smaller than SRAM. However, in absence of back to back inverter, there is no feedback loop to hold the bit value to a 0 or 1. So, periodic refreshing of the value is needed, which slows DRAM further. Since it needs to be refreshed periodically, it's called dynamic. All the memory that you hear in news, journals, etc is this DRAM. This memory is the one used on external memory modules that you buy from BestBuy, Amazon etc (known as DDR memory cards). They can go as large as 128GB or more (Samsung already reported 512GB DRAM memory modules available). DRAM started out as SDR DRAM, and then moved to DDR style DRAM. DRAM are also known as SDRAM (synchronous DRAM), as all signals are driven synchronous to a clock. NOTE: SDRAM and SDR DRAM are referring to 2 different things.

 

Next we look at each of these meories in detail:

A. SDR

B. DDR

DDR1

DDR2

DDR3

DDR4

DDR5

LP DDR

 

Foundations of CNN - Course 4 week 1

This course goes over basics of CNN. Detecting edges is the basic motivation behind CNN. In anypicture, we want to detect horizontal and vertical edges, so that we can identify boundaries of different things in the picture.

We construct a filter (or a kernel) with some dimension, and then convolve it with a picture to get an output. The convolution operator is denoted by asterisk (*) which is the same operator that's used in  multiplication. This causes confusion, but that's what has been used in Digital signal processing Convolution operations, so we use same notation for operator here. In python, func "conv_forward" does convolution, while in TF, tf.nn.conv2d does the job.

convolution just applies the operation of convolution for a given filter on all parts of the picture, one part at a time. When convolving, we just multiply element wise each entry of filter with each entry of picture, and sum them up to get a single number. See the example explained in lecture.

ex: A 6x6 matrix convolved with a 3x3 matrix gives 4x4 matrix.

Edge Detectors:

An example of vertical edge detector would be a 3x3 filter with 1st column as all1, then 2nd col as al 0, and 3rd col as all -1. This detects edges, if we associate +ve numbers with whiteness, -ve numbers with darkness, and 0 being in b/w white and black (i.e gray). We can also make a horizontal detector, by switching rows with columns, i.e 1st row is all 1, 2nd row is all 0, and 3rd row is all -1.

Instead of hard coding these 9 values in a edge detector filter, we can define them as 9 parameters: w1 to w9, and let NN pick up the most optimal numbers. Back propagation is used to learn these 9 parameters. This gives the best results.

Padding and Striding:

Valid Conv: Here o/p matrix shape is not same as i/p matrix shape.

A nxn picture convolved with fxf filter gives matrix with dimension (n-f+1) x (n-f+1). That's why 6x6 matrix convolved with 3x3 filter gave 4x4 o/p (as n=6, f=3, so o/p = 6-3+1=4)

Same conv: To keep the dimension of o/p the same as that of i/p pic, we can use padding, where we pad picture border with extra pixels on the boundary of pic. This involves adding row or col of 0 or 1 or some other value. We can choose padding number p such that the o/p matrix dim remain same as that of i/p pic.

With padding p, a n x n picture (padded with p pixels on each side of pic on border) convolved with f x f filter gives matrix with dimension (n+2p-f+1) x (n+2p-f+1). That's why 6x6 matrix (with p=1) convolved with 3x3 filter gives 6x6 o/p (as n=6, p=1, f=3, so o/p = 6+2-3+1=6). so, o/p matrix retains same shape as i/p matrix.

For any general shape of i/p matrix, we have to choose p such that o/p matrix shape is same as i/p matrix shape. For that to happen, n+2p-f+1 = n => p=(f-1)/2. So, for filter of size=3, we have to choose p=(3-1)/2=1.

With padding, we increase the size of o/p matrix. Striding does opposite of that where it reduces the size of o/p matrix. Striding is where we jump by more than 1 when calculating conv for adjoining boxes. So far, we used a stride of 1 for all our conv, but we could have used any stride number as 2, 3, etc. We do this stride or skipping in both horizontal and vertical directions.

With stride s, a n x n picture (padded with p pixels on each side of pic on border, and stride s) convolved with f x f filter gives matrix with dimension floor((n+2p-f)/s+1) x floor((n+2p-f)/s+1). We use floor function incase numbers don't divide to give an integer.

By using padding and striding together, we can do "same conv".

Convolution over Volume:

So far we have been doing conv over 2D matrix. We can extend this concept to do conv over volume (i.e 3D matrix). In such a case, the i/p matrix is 3D (where the 3rd dimension is for channel, i.e each 2D matrix is for separate color R, G, B). The filter is also 3D. The o/p matrix in such a case is still 2D with same dim as before (n-f+1) x (n-f+1) (assuming p=0, and s=1).

Conv over volume is same as that over area: multiplication and addition is done over all elements including the 3rd dim. So, o/p returned for each conv operation is still a single value for one given box.

However, if we have more than 1 filter for conv operation (i.e one filter is for vertical edge detection, while other filter is for horizontal edge detection, and so on), then the o/p matrix becomes a 3D matrix.

For N filters being applied on i/p pic with dim n x n x nc and filter with dim f x f x nc , the o/p matrix shape would be (n-f+1) x (n-f+1) x N.

Note that nc which is the number of channels in the i/p has to be the same for the filter.

Ex: An i/p pic of 6x6x3 conv with 2 filters of shape 3x3x3 gives o/p matrix of shape 4x4x2 (since n=6, f=3, nc=3 and N=2)

1 Layer of CNN:

For CNN also, we have multiple layers as in Deep NN. In Deep NN, for each layer, we compute activation func a[l]=g(z[l]) where g is the function used for that layer and z[l] = w[l] *a[l-1] + b[l] (* here means matrix multiplication).

In CNN, for each layer, we compute convolution instead of matrix multiplication. So, for i/p layer a[0], z[1] = w[1] *a[0] + b[1]  where w[1] is the filter matrix, and b[1]   is the offset added as before. Here asterisk * refers to convolution operation. Then we use activation function as ReLU, sigmoid, etc to compute o/p matrix a[1]=g(z[1]) . This is true even if we have more than 1 filter, our weight matrix will just have one extra dim for the number of filters.

In general for each layer "l" , we have following relation:

f[l] = filter size

p[l] = padding size

s[l] = stride size

nc[l] = number of filters. Each filter is of dim f[l] x f[l] x nc[l-1] 

dim for "l"th i/p layer a[l-1]  = nh[l-1]  x nw[l-1]  x nc[l-1] where nh = number of pixels across height of pic, nw = number of pixels across width of pic, nc = number of color channels of pic (for RGB, we have 3 channels), 

dim for "l"th o/p layer a[l-1] = nh[l]  x nw[l]  x nc[l] where nh[l]  = floor( (nh[l-1]  + 2p[l] - f[l])/s[l] + 1 ) , nw[l]  = floor( (nw[l-1]  + 2p[l] - f[l])/s[l] + 1 ) 

For m examples, A[l-1] = m x nh[l]  x nw[l]  x nc[l] 

dim of weight matrix w[l] = f[l]  x f[l]  x nc[l-1] x nc[l], where nc[l], is the number of filters in layer "l"

dim of bias matrix b[l] = 1 x 1 x 1 x nc[l] => bias is a single number for each filter, so for nc[l] filters, we have nc[l] parameters.

Example of Conv NN: provided in lecture

3 Types of layers in conv NN: Just using convolution layers may suffice to give us good results, but in practise, supplementing CONV layers with POOL layers and FC layers results in better results.

  1. convolution layer (CONV): This is about using the convolution operator.
  2. Pooling layer (POOL): This is about using max or avg of a subset of matrix, so as to reduce the size of matrix.
  3. Fully connected layer (FC): This is similar to conventional NN, where we connect each i/p entry to each o/p entry which results in a lot of weights being used. But since we use the FC feature in the last few stages of the NN, the size of matrix is greatly reduced by that time, resulting in fewer entries in weight matrix.

Reasons for using Conv NN: (see in last lecture)

  1. Parameter sharing: Same conv filter can be used at multiple places in the image
  2. Sparsing of connections: Not each i/p needs to be connected to o/p, since most of the o/p only depend on a subset of i/p matrix.

 

 Finding optimal values of Weights:

We use same technique of gradient descent to find the lowest value of cost given different weight matrix, and filters. The derivation is not shown in programming assignment, but look in my hand written notes.

 

 Assignment 1:

 

Assignment 2:

 

 

 

 

 

 

 

Course 4 - Convolution Neural Networks

This course is one of the most important course on NN, as convolution NN (CNN) is the one that is used most of the places in computer vision. Computer vision is the discipline of CS where we extract features in any given picture or video, i.e in autonomous cars, it's the art of extracting features from picture such as other cars, pedestrians, etc. CNN has been very successful in Computer vision.

There are 4 sections in this course:

1. Foundations of CNN: This is a lengthy course (2 hrs) as it talks about basics of CNN (conv layers and pooling layers). It explains this with some basic examples. Spend some time on this course. Go over it again so that you get the basics. There are 2 programming assignments

2. Deep Convolutional models: case studies: It has 1 pgm assgn on Residual NN (RNN)

3. Object detection: It has 1 pgm assgn on "car detection with YOLO"

4. Special applications: Facial recognition and neural style transfer: This has 2 pgm assgn. 1st one is "art generation with neural style transfer", while 2nd one is on "facial recognition"