29
Cultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian, CVC, [email protected], Hugo Escalante, INAOE, Xavier Baró, UOC, Sergio Escalera, CVC/UB, Jordi González, CVC, Pablo Pardo, UB, Marc Simon, UB, Isabelle Guyon, Chalearn

Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Cultural Event Recognition (Demo)

ChaLearn Looking at People Workshop

Junior Fabian, CVC, [email protected], Hugo Escalante, INAOE, Xavier

Baró, UOC, Sergio Escalera, CVC/UB, Jordi González, CVC, Pablo Pardo, UB, Marc

Simon, UB, Isabelle Guyon, Chalearn

Page 2: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Contents

• Introduction

• Overview

• AWS – instructions• AWS – instructions

• Running a basic deep learning model on challenge data

• GPU vs CPU

• Final remarks

Page 3: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Cultural event recognition challenge

• The Cultural Event Recognition challenge aims to investigate the

performance of recognition methods based on several cues like garments,

human poses, objects, background, etc.

• To this end, our dataset contains significant variability in terms of clothes,

actions, illumination, localization and context. This is the second round foractions, illumination, localization and context. This is the second round for

this track. We have significantly incremented the number of images and

classes

Page 4: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Data

Page 5: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Cultural event recognition challenge

Page 6: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Demo overview

• The goal of the demo is to show the benefits of

using GPUs over CPUs when training a basic deep

learning method for recognizing cultural events.

• Demo in a nutshell:

– Use Amazon Web Services for launching a server with

GPUs

– Run a basic of-the-shell model using Theano

– A subset of the challenge data will be used

Prerequisites: create an account in AWS

Page 7: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Go to https://console.aws.amazon.com/

Login [create your own account]

Page 8: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Spot requests

Page 9: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Request Spot Instances

Page 10: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Real stuff: Choose North California

Page 11: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Image for the demo

Page 12: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Select server configuration

Page 13: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Select price*

* It depends on the current price

Page 14: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Launch server

Page 15: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Select Key Pair

If you

already

have one

Page 16: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

OR: Create new key pair

Choose

name

Save demohack15.pem

In directory where saved, at terminal do:

chmod 0400 demohack15.pem

ssh-add -K demohack15.pem Put key in key ring, so you can omit -i option

Page 17: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

View spot requests

Wait until server

is created, then

select it.

Page 18: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Connect to your server

ssh -i demohack15.pem [email protected]

Omit -i option if the key is in the key ring.

Page 19: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Create VM image

Page 20: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Terminate instance

• Do not forget to terminate the instances!

Page 21: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Running the demo

• In the server we already have the Code and

Data to run the demo

This is the script to run:

>python run.py

Page 22: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

• This script shows how training and testing a simple CNN

model for the cultural event recognition data set.

• The script is based on the code of convolutional neural

networks (CNNs) from the Theano tutorial.

Running the demo

• For the demo we only use 50 classes and we have resized the

images to 50x50.

• The code from Theano tutorial was used to deal with

the MNIST dataset. For our cultural event dataset our goal is

not to look for the best model but for its computational

requirements in CPU and GPU, which can also generalize to

other more complex models.

Page 23: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

• The most important in this demo is to solve the problem using

CNN and to compare the execution time in GPU vs. CPU.

Running the demo

Page 24: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

• [Code]� cnn.py – defines 3 classes: hidden layer, convolutional layer and the whole CNN

� logistic_sgd.py – auxiliary file, which contains the logistic regression class

� cnn_training_computation.py – Contains the definition of the training and prediction process.

Running the demo

• Defines:l - the Theano shared (shared memory on the GPU) variables, storing the datasets and labelsl - CNN structural parametersl - training parametersl - training flow (method) and its auxiliary functions

l - prediction flow and its auxiliary functions

� run.py – the main program that executes our deep learning example. It reads the datasets, performs normalization, trains the CNN and do predictions.

Page 25: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Results

TIME (minutes)

GPU 11.45m

CPU 178.52m

TIME (minutes)

50x5050x50acc = 15,08%

GPU 30.11m

CPU 495.56m ~8h

TIME (minutes)

GPU 85.21m

CPU 1375.64 ~23h

100x100acc = 18,36%

200x200acc = 28,07%

Page 26: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Final remarks

• A very basic DL model was evaluated in thecontext of the cultural-event recognitionchallenge

• This demo is illustrative of the benefits of using• This demo is illustrative of the benefits of usingGPUs for deep learning

• More complex models, based on theano/pythoncould be run following the same instructionsherein described.

Page 27: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Sponsors & organizers

Page 28: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,

Questions?Questions?

Page 29: Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural Event Recognition (Demo) ChaLearn Looking at People Workshop Junior Fabian , CVC,