Cultural Event Recognition (Demo)sunai.uoc.edu/chalearnLAP/2015/demo/HackathonCultural.pdfCultural...

Preview:

Citation preview

Cultural Event Recognition (Demo)

ChaLearn Looking at People Workshop

Junior Fabian, CVC, jfabian@cvc.uab.es, Hugo Escalante, INAOE, Xavier

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

Simon, UB, Isabelle Guyon, Chalearn

Contents

• Introduction

• Overview

• AWS – instructions• AWS – instructions

• Running a basic deep learning model on challenge data

• GPU vs CPU

• Final remarks

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

Data

Cultural event recognition challenge

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

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

Login [create your own account]

Spot requests

Request Spot Instances

Real stuff: Choose North California

Image for the demo

Select server configuration

Select price*

* It depends on the current price

Launch server

Select Key Pair

If you

already

have one

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

View spot requests

Wait until server

is created, then

select it.

Connect to your server

ssh -i demohack15.pem ubuntu@52.53.253.127

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

Create VM image

Terminate instance

• Do not forget to terminate the instances!

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

• 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.

• 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

• [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.

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%

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.

Sponsors & organizers

Questions?Questions?