A Quick Look at Im­age Pro­cess­ing with Deep Learn­ing

So­cial me­dia net­works like Facebook have a large user base and an even larger ac­cu­mu­la­tion of data, both vis­ual and oth­er­wise. Face recog­ni­tion is an im­por­tant fea­ture of such sites, and has been made pos­si­ble by deep learn­ing. Let’s find out how.

OpenSource For You - - Developers -

Deep learn­ing is a type of ma­chine learn­ing in which a model learns to per­form clas­si­fi­ca­tion tasks di­rectly from images, text or sound. Deep learn­ing is usu­ally im­ple­mented us­ing neu­ral net­work ar­chi­tec­ture. The term deep refers to the num­ber of lay­ers in the net­work—the more the lay­ers, the deeper the net­work. Tra­di­tional neu­ral net­works con­tain only two or three lay­ers, while deep net­works can have hun­dreds.

In Fig­ure 1, you can see that we are train­ing the sys­tem to clas­sify three an­i­mals – a dog, a cat and a honey bad­ger.

A few ap­pli­ca­tions of deep learn­ing

Here are just a few ex­am­ples of deep learn­ing at work: A self-driv­ing ve­hi­cle slows down as it ap­proaches a pedes­trian cross­ing.

An ATM re­jects a coun­ter­feit bank note.

A smart­phone app gives an in­stant trans­la­tion of a street sign in a for­eign lan­guage.

Deep learn­ing is es­pe­cially well-suited to iden­ti­fi­ca­tion ap­pli­ca­tions such as face recog­ni­tion, text trans­la­tion, voice recog­ni­tion, and ad­vanced driver as­sis­tance sys­tems, in­clud­ing lane clas­si­fi­ca­tion and traffic sign recog­ni­tion.

The learn­ing process of deep neu­ral net­works

A deep neu­ral net­work com­bines mul­ti­ple non-linear pro­cess­ing lay­ers, us­ing sim­ple el­e­ments op­er­at­ing in par­al­lel. It is in­spired by the bi­o­log­i­cal ner­vous sys­tem, and con­sists of an in­put layer, sev­eral hid­den lay­ers, and an out­put layer. The lay­ers are in­ter­con­nected via nodes, or neu­rons, with each hid­den layer us­ing the out­put of the pre­vi­ous layer as its in­put.

How a deep neu­ral net­work learns

Let’s say we have a set of images, where each im­age con­tains one of four dif­fer­ent cat­e­gories of ob­jects, and we want the deep learn­ing net­work to au­to­mat­i­cally recog­nise which

ob­ject is in each im­age. We la­bel the images in or­der to have train­ing data for the net­work.

Us­ing this train­ing data, the net­work can then start to un­der­stand the ob­ject’s spe­cific fea­tures and as­so­ciate them with the cor­re­spond­ing cat­e­gory. Each layer in the net­work takes in data from the pre­vi­ous layer, trans­forms it, and passes it on. The net­work in­creases the com­plex­ity and de­tail of what it is learn­ing from layer to layer. No­tice that the net­work learns di­rectly from the data—we have no in­flu­ence over what fea­tures are be­ing learned.

Im­ple­men­ta­tion: An ex­am­ple us­ing AlexNet

If you’re new to deep learn­ing, a quick and easy way to get started is to use an ex­ist­ing net­work, such as AlexNet, which is a CNN (con­vo­lu­tional neu­ral net­work) trained on more than a mil­lion images. AlexNet is com­monly used for im­age clas­si­fi­ca­tion. It can clas­sify images into 1000 dif­fer­ent cat­e­gories, in­clud­ing key­boards, com­puter mice, pen­cils, and other of­fice equip­ment, as well as var­i­ous breeds of dogs, cats, horses and other an­i­mals.

You will re­quire the fol­low­ing soft­ware:

1. MAT­LAB 2016b or a higher ver­sion

2. Neu­ral Net­work Tool­box

3. The sup­port pack­age for us­ing Web cams in MAT­LAB (https://in.math­works.com/mat­lab­cen­tral/file­ex­change/45182mat­lab­sup­port­pack­age­for­usb­we­b­cams)

4. The sup­port pack­age for us­ing AlexNet (https:// in.math­works.com/mat­lab­cen­tral/file­ex­change/59133neu­ral­net­work­tool­box­tm­­model­for­alexnet­net­work)

After load­ing AlexNet, con­nect to the Web cam and cap­ture a live im­age.

Step 1: First, give the fol­low­ing com­mands: cam­era = we­b­cam; % Con­nect to the cam­era nnet = AlexNet; % Load the neu­ral net pic­ture = cam­era.snapshot; % Take a pic­ture

Step 2: Next, re­size the im­age to 227 x 227 pix­els, the size re­quired by AlexNet:

pic­ture = im­re­size(pic­ture,[227,227]); % Re­size the pic­ture Step 3: AlexNet can now clas­sify our im­age:

la­bel = clas­sify(nnet, pic­ture); % Clas­sify the pic­ture im­age(pic­ture); % Show the pic­ture ti­tle(char(la­bel)); % Show the la­bel

Step 4: Give the fol­low­ing com­mand to get the out­put: out­put:

Fig­ure 3: Neu­ral net­work data train­ing ap­proach

Fig­ure 1: The deep learn­ing ap­proach

Fig­ure 2: Deep learn­ing neu­ral net­works

Fig­ure 5: AlexNet

Fig­ure 4: Im­age pro­cess­ing us­ing deep learn­ing

Fig­ure 6: The Web cam’s out­put

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.