11
SmartVisionApp: A framework for computer vision applications on mobile devices Cristiana Casanova, Annalisa Franco, Alessandra Lumini , Dario Maio DISI, Università di Bologna, Via Sacchi 3, 47521 Cesena, Italy article info Keywords: Computer vision Content analysis Image classification Mobile landmark recognition abstract In this paper a novel framework for the development of computer vision applications that exploit sensors available in mobile devices is presented. The framework is organized as a client–server application that combines mobile devices, network technologies and computer vision algorithms with the aim of per- forming object recognition starting from photos captured by a phone camera. The client module on the mobile device manages the image acquisition and the query formulation tasks, while the recognition module on the server executes the search on an existing database and sends back relevant information to the client. To show the effectiveness of the proposed solution, the implementation of two possible plug- ins for specific problems is described: landmark recognition and fashion shopping. Experiments on four different landmark datasets and one self-collected dataset of fashion accessories show that the system is efficient and robust in the presence of objects with different characteristics. Ó 2013 Elsevier Ltd. All rights reserved. 1. Introduction Computer vision is the science aimed to understand the content of images or other complex data acquired by means of different kinds of devices and sensors (Morris, 2004); these techniques are extremely useful in a wide range of possible applications, in fields such as medicine, industrial processes and security. Each computer vision application has the goal of gathering useful information based on visual clues extracted from data acquired from static images, video sequences or other data sources. Computer vision is a research area widely studied and investigated in the past dec- ades, but now the growing diffusion of mobile devices with their high processing capabilities and powerful sensors like camera, GPS and compass has renewed the interest in this field, since smartphones and tablets turned to be an ideal platform for com- puter vision application. Many possible applications could benefit from the capability of computer vision techniques to perform ob- ject recognition with mobile devices; some examples are mobile shopping (where the user can be interested in obtaining informa- tion about a product), personalized mobile services (e.g. for pur- chasing tickets), mobile landmark recognition for tourists or people recognition (for tagging, etc.). These themes are central also to the smart city concept and recur in its definitions. A smart city is a high-performance urban context, where citizens become actors, integral part of the system (Schaffers, Komninos, & Pallot, 2012). Among ICT concepts for smart city, the possibility of collecting location- and time-aware data from the urban context and make them available to the citizens is a particularly interesting feature that has been researched in the last years (Calderoni, Maio, & Palm- ieri, 2012). In this context a new framework that combines mobile devices, network technologies and computer vision algorithms to address the problem of object recognition from static images is proposed. This framework has been developed at the Smart City Lab (http://smartcity.csr.unibo.it), a research laboratory part of DISI (Department of Computer Science and Engineering) – University of Bologna. The framework has been designed for general purpose applica- tions involving object recognition on the basis of visual, textual and spatial information. Moreover, to show the effectiveness of the proposed solution, the implementation of two possible plug-ins for specific problems is described: landmark recognition and fash- ion shopping. The landmark recognition plug-in allows users to discover information about monuments: both exact and approxi- mated queries are possible and detailed information about the monuments is retrieved for each result found. The fashion shop- ping performs analogous queries in the context of clothes and accessories. Both plug-ins allow to combine information of differ- ent nature (shape, color, textual information, position, ...) on the basis of the user preferences. Anyway the searching capabilities of the two plug-ins are quite different, in order to fit the problem requirements. For landmark recognition the search will be directed to find an image representing the same object of the given photo, 0957-4174/$ - see front matter Ó 2013 Elsevier Ltd. All rights reserved. http://dx.doi.org/10.1016/j.eswa.2013.04.037 Corresponding author. Tel.: +39 0547339236. E-mail addresses: [email protected] (C. Casanova), annalisa. [email protected] (A. Franco), [email protected] (A. Lumini), dario.maio@ unibo.it (D. Maio). Expert Systems with Applications 40 (2013) 5884–5894 Contents lists available at SciVerse ScienceDirect Expert Systems with Applications journal homepage: www.elsevier.com/locate/eswa

SmartVisionApp: A framework for computer vision applications on mobile devices

  • Upload
    dario

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SmartVisionApp: A framework for computer vision applications on mobile devices

Expert Systems with Applications 40 (2013) 5884–5894

Contents lists available at SciVerse ScienceDirect

Expert Systems with Applications

journal homepage: www.elsevier .com/locate /eswa

SmartVisionApp: A framework for computer vision applications onmobile devices

0957-4174/$ - see front matter � 2013 Elsevier Ltd. All rights reserved.http://dx.doi.org/10.1016/j.eswa.2013.04.037

⇑ Corresponding author. Tel.: +39 0547339236.E-mail addresses: [email protected] (C. Casanova), annalisa.

[email protected] (A. Franco), [email protected] (A. Lumini), [email protected] (D. Maio).

Cristiana Casanova, Annalisa Franco, Alessandra Lumini ⇑, Dario MaioDISI, Università di Bologna, Via Sacchi 3, 47521 Cesena, Italy

a r t i c l e i n f o a b s t r a c t

Keywords:Computer visionContent analysisImage classificationMobile landmark recognition

In this paper a novel framework for the development of computer vision applications that exploit sensorsavailable in mobile devices is presented. The framework is organized as a client–server application thatcombines mobile devices, network technologies and computer vision algorithms with the aim of per-forming object recognition starting from photos captured by a phone camera. The client module onthe mobile device manages the image acquisition and the query formulation tasks, while the recognitionmodule on the server executes the search on an existing database and sends back relevant information tothe client. To show the effectiveness of the proposed solution, the implementation of two possible plug-ins for specific problems is described: landmark recognition and fashion shopping. Experiments on fourdifferent landmark datasets and one self-collected dataset of fashion accessories show that the system isefficient and robust in the presence of objects with different characteristics.

� 2013 Elsevier Ltd. All rights reserved.

1. Introduction

Computer vision is the science aimed to understand the contentof images or other complex data acquired by means of differentkinds of devices and sensors (Morris, 2004); these techniques areextremely useful in a wide range of possible applications, in fieldssuch as medicine, industrial processes and security. Each computervision application has the goal of gathering useful informationbased on visual clues extracted from data acquired from staticimages, video sequences or other data sources. Computer visionis a research area widely studied and investigated in the past dec-ades, but now the growing diffusion of mobile devices with theirhigh processing capabilities and powerful sensors like camera,GPS and compass has renewed the interest in this field, sincesmartphones and tablets turned to be an ideal platform for com-puter vision application. Many possible applications could benefitfrom the capability of computer vision techniques to perform ob-ject recognition with mobile devices; some examples are mobileshopping (where the user can be interested in obtaining informa-tion about a product), personalized mobile services (e.g. for pur-chasing tickets), mobile landmark recognition for tourists orpeople recognition (for tagging, etc.). These themes are central alsoto the smart city concept and recur in its definitions. A smart city isa high-performance urban context, where citizens become actors,

integral part of the system (Schaffers, Komninos, & Pallot, 2012).Among ICT concepts for smart city, the possibility of collectinglocation- and time-aware data from the urban context and makethem available to the citizens is a particularly interesting featurethat has been researched in the last years (Calderoni, Maio, & Palm-ieri, 2012).

In this context a new framework that combines mobile devices,network technologies and computer vision algorithms to addressthe problem of object recognition from static images is proposed.This framework has been developed at the Smart City Lab(http://smartcity.csr.unibo.it), a research laboratory part of DISI(Department of Computer Science and Engineering) – Universityof Bologna.

The framework has been designed for general purpose applica-tions involving object recognition on the basis of visual, textual andspatial information. Moreover, to show the effectiveness of theproposed solution, the implementation of two possible plug-insfor specific problems is described: landmark recognition and fash-ion shopping. The landmark recognition plug-in allows users todiscover information about monuments: both exact and approxi-mated queries are possible and detailed information about themonuments is retrieved for each result found. The fashion shop-ping performs analogous queries in the context of clothes andaccessories. Both plug-ins allow to combine information of differ-ent nature (shape, color, textual information, position, . . .) on thebasis of the user preferences. Anyway the searching capabilitiesof the two plug-ins are quite different, in order to fit the problemrequirements. For landmark recognition the search will be directedto find an image representing the same object of the given photo,

Page 2: SmartVisionApp: A framework for computer vision applications on mobile devices

C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894 5885

while for fashion shopping a similarity search is required in orderto discover several objects similar to the given one. For this reasonthe vision components implemented for the two plug-ins and de-scribed in Section 4 use different visual features.

For both applications the system grants two functionalities:

� Image search: The user can discover information about theinput image by specifying particular searching criteria; thisfunctionality involves a comparison between the input imageand the pictures stored in the database based on proximity, tagsor visual content;� System knowledge base update: The user can contribute to pop-

ulate the knowledge base by adding new contents (images andrelated information).

The rest of this paper is organized as follows. In Section 2, relatedwork is provided. In Section 3, the architecture of the proposedsystem is described in detail; in Section 4 the implementation ofthe computer vision components (related to both applications) isdescribed. Experiments on several benchmark datasets are dis-cussed in Section 5, and finally conclusions and future researchdirections are given in Section 6.

2. Related works

In recent years, with the improvement of image retrieval algo-rithms, researchers have given more attention to the image searchengine and have introduced several systems for landmark recogni-tion or object recognitions. In particular many applications havebeen developed for mobile devices, where built-in cameras andnetwork connectivity make them increasingly attractive for usersto take pictures of objects and then obtain relevant informationabout them. Most of proposed apps focus on a single problemand are based on new algorithms for content analysis, landmarkclassification or object recognition (Yap, Chen, Li, & Wu, 2010).

The first pioneer studies that used the built-in camera of a mo-bile phone for image retrieval proposed the use of existing search-ing engine to perform the search. In Yeh, Tollmar, and Darrell(2004) a two-steps system based on images and text is proposed,where images are first searched on the web, then text extractedfrom the webpages is used to query Google text search engine.Some research reports results obtained on images taken by a phonecamera but processed offline. For example in Fritz, Seifert, Kumar,and Paletta (2005) a building detection approach is proposed,based on the i-SIFT descriptors, an ‘‘Informative Descriptor Ap-proach’’ obtained by extracting color, orientation and spatial infor-mation for each Scale-Invariant Feature Transform (SIFT) feature.Other context aware content works that focus on large-scale land-mark non-mobile recognition are presented in Schindler, Brown,and Szeliski (2007) and Zamir and Shah (2010).

Some experiments about the use of image retrieval methods tolocate information around the world are reported in Jia, Fan, Xie,Li, and Ma (2006). Other attempts of using text to improve imageor video retrieval are reported in Sivic and Zisserman (2003) wherethe authors use ‘‘visual words’’ for object matching in videos. Afterthat, other researches focused on finding out the better way to gen-erate the visual words (Jégou, Douze, Schmid, & Pérez, 2010; Zhang,Marszalek, Lazebnik, & Schmid, 2007) resulting in a very performingapproach named ‘‘bag of visual words’’ (Sivic & Zisserman, 2009).

As mobile phones with imaging and locating capability arebecoming more widespread, several works about mobile land-mark recognition have been proposed (Bhattacharya & Gavrilova,2013). In Redondi, Cesana, and Tagliasacchi (2012) an efficientcoding of Speeded Up Robust Features (SURF) descriptors suit-able for low-complexity devices is proposed, and a comparativestudy of lossy coding schemes operating at low bitrate is carried

out. In order to avoid the latency of an image upload over aslow network, in Hedau, Sinha, Zitnick, and Szeliski (2012) a ur-ban landmark recognition approach computed on client is pro-posed: the presented method involves uploading only GPScoordinates to a server, then downloading a compact location-specific classifier (trained on few geo-tagged images in the near-by of the searched object) and performing recognition on theclient. Differently from our method, this approach requires bothvisual data and GPS coordinates for the search. Recognition onclient is used also in Takacs et al. (2008) where an outdoorsaugmented reality system for mobile phones is proposed. Cam-era-phone images are matched on board against a database oflocation-tagged images using a robust image retrieval algorithmbased on SURF descriptors. Matching is performed against a re-duced database of highly relevant objects, which is continuouslyupdated to reflect changes in the environment (according toproximity to the user).

3. System architecture

The system was designed according to a client–server architec-ture, where the client is a mobile device and the server is a physicalmachine that processes the images sent from the client. A graphicalschema of the software architecture is reported in Fig. 1 for thefunctionality of image search and in Fig. 2 for the functionality ofsystem knowledge base update, respectively.

The client application, designed for Android platforms, performsthe following tasks:

� User mode selection: It allows the user to select the category ofobjects of interest among the existing possibilities; in the pres-ent prototype the following choices are available: monuments,clothes, and accessories.� Image acquisition: This function allows the user to take a photo

or to select an image from the photo gallery.� Query: The input image is sent to the server. On the basis of the

category selected and of the searching criteria provided by theuser, the server searches the input image in the system knowl-edge database and sends back the related information. If amatch is not found in the database, the user can exploit the sys-tem knowledge base update functionality to add the image andrelated information.� Results visualization: The best match or a ranked list of images

is displayed to the user.

In Fig. 3 a screenshot of the client application for each of thetasks described above is reported.

The user can select different searching criteria, according to thecategory of objects selected. In case of landmark recognition thefollowing options are available:

� Perform exact or approximated queries without spatial con-straints: The landmark in the image (exact) or similar land-marks (approximated) are retrieved without any reference tospatial coordinates;� Perform exact or approximated queries with spatial constraints:

The landmark in the image (exact) or similar landmarks(approximated) are retrieved at a range distance selected bythe user; the GPS coordinates (latitude and longitude) areexploited to this aim.

For the fashion shopping module the following two options areavailable:

� Recognize a given object on the basis of color, shape, or a com-bination of both.

Page 3: SmartVisionApp: A framework for computer vision applications on mobile devices

Fig. 1. Software architecture of ‘‘image search’’ functionality.

Fig. 2. Software architecture of ‘‘system knowledge base update’’ functionality.

Fig. 3. Screenshots of the client application for: (a) User mode selection, (b) Image acquisition, (c) Query, (d) Results visualization.

5886 C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894

� Search the DB by keywords in order to find objects according tospecific searching criteria (stylist, price, shape, etc.)

The server is composed by the following modules:

� The Java server is designed to decode the input image, send it tothe computer vision component, retrieve data from the data-base (querying by specific searching criteria) and send backthe result to the client;

Page 4: SmartVisionApp: A framework for computer vision applications on mobile devices

Table 2Database schema on the ‘‘clothes/accessories’’ table.

Clothes/accessories Description

Field Type

ID Numerical Internal identifierStylist Text Stylist or designerType Text (Jacket, skirt, etc.)Color Text ColorURL Text Link to Wikipedia for detailed informationImage Text Name of the image file

C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894 5887

� The computer vision component is devoted to image processing,involving feature extraction and matching against stored data.Since all the main procedures of a computer vision applicationare strictly problem-dependent, the methods for image prepro-cessing, feature extraction and classification are not included inthe general framework and are considered as a part of the plug-in component.

The communication between client and server is performedaccording to the following protocols:

� Socket protocol is one of the main technologies of computer net-working, allowing applications to communicate using standardmechanism built into network hardware and operating sys-tems. This protocol is used for image transferring from mobiledevice to the server, decoding the input image into a byte arrayand sending it to the Java server. The use of the socket protocolcauses low traffic network and it is faster than the Http protocoleven if more difficult to manage.� HTTP protocol is used to send parameters and images in order to

add a new object to the system database. The update function-ality has been implemented using this protocol since it allows asimple communication with the PHP script which performs‘‘system knowledge base update’’ task.

The internal database is stored in MySQL and designed usingphpMyAdmin. A table for each plug-in is needed; the tables forstoring data for monument and fashion modules are designedaccording to schemas in Tables 1 and 2.

If the user performs a search on the basis of specific search cri-teria, the system performs a simple SQL query combining filters toretrieve the relative information. In this case a similarity search onthe input image is not needed. On the contrary, when the user re-quire a similarity search by using the input image, the searchingprocess is performed by the computer vision components as ex-plained in the following sections. After the ID of the correspondingobject is retrieved, a SQL query is executed to obtain the completeinformation.

The testing application has been developed using the followinghardware and software configurations:

� Client: The user interface has been designed for Android 2.3 andoptimized for Samsung Galaxy S I9000 and Samsung Galaxy SIIII9300.� Server: The server runs on a Window 7 Pro 64bit machine (PC

with Intel i5-2500 3.30 GHz 8 GB RAM) with MATLAB R2011aand Java SE 7.

4. Computer vision components

A general computer vision system consists of:

Table 1Database schema on the ‘‘monuments’’ table.

Monuments Description

Field Type

ID Numerical Internal identifierName Text NameType Text Architectural styleArchitect Text ArchitectCity Text City where the monument is locatedLatitude Numerical GPS latitudeLongitude Numerical GPS longitudeDescription Text A short description about the monumentURL Text Link to Wikipedia for detailed informationImage Text Name of the image file

� Data acquisition and preprocessing, performed in the proposedframework by the client;� Feature extraction: Characterization of an object by descriptors

possibly with high discriminating capability and robustness topossible object variations.� Matching: Evaluation of the similarity among descriptors in

order to recognize the input object or identify it as a memberof a predefined class.

In this work the practical implementation of the different com-ponents strictly depends on the search functionality (landmark orfashion objects recognition) since the salient features of differentobject categories usually vary significantly.

4.1. Landmark recognition module

The visual features commonly used for landmark recognitioncan be divided into two categories (Chen, Wu, Yap, Li, & Tsai,2009):

� Global features: They are based on color, edge and texture.Color is one of the simplest features to recognize landmarksbut, unfortunately, it is sensitive to changes in illuminationand contrast.� Local features: They are widely used in landmark recognition

due to their high capability of describing the region of inter-est. The most popular approaches for local-features extractionare the keypoint-based technique (Jiang, 2010) and the dense-sampling approach (Nowak, Jurie, & Triggs, 2006). Keypoint-based features, including SIFT (Lowe, 2004), are widely usedin this problem because of their robustness to changes in illu-mination, scale, occlusion and background clutter. The dense-sampling approach extracts visual features from local patchesrandomly or uniformly driven from the images. One of themost used techniques to represent an image using patch fea-tures is the bag-of-word method (BoW) (Csurka, Dance, Lixin,Willamowski, & Bray, 2004). BoW is inspired by models usedin natural language processing: the idea is to treat an imageas a document and represent it as a sparse histogram overa codebook of ‘‘words’’: the codebook is obtained by perform-ing vector quantization of the patch descriptors from all theclasses, then building a histogram of the codewords as finaldescriptor.

In this work a local feature approach based on SIFT and BoW isadopted. A graphical schema of our approach is shown in Fig. 4.

The codebook creation process (performed only once during thetraining stage) can be summarized as follows:

� Collect SIFT features from images: The local patches are locatedand described using the Scale Invariant Feature Transform(SIFT): it detects keypoints as maxima or minima of a differ-ence-of-Gaussian function; at each point a feature vector is

Page 5: SmartVisionApp: A framework for computer vision applications on mobile devices

Fig. 4. Bag-of-visual-words process.

5888 C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894

extracted that is invariant to image translation, scaling, androtation, and partially invariant to illumination changes andaffine or 3D projection.� Use k-means to cluster the features extracted into a visual vocabu-

lary: Given a set of training images from different landmarks, avector quantization of features is performed and the k-meansalgorithm is used to group keypoints from each landmark. Inorder to limit the number of descriptors in the codebook, eachcluster centroid is selected to represent a visual word and isadded to the visual dictionary.

The representative visual words selected above are then usedfor feature extraction (both for representing the images in thedatabase and for describing the query images). Feature extractionconsists of building a histogram of the visual word frequencies.Each image is represented as a histogram of codewords by assign-ing each SIFT descriptor extracted from the image to the nearestword in the dictionary.

The recognition of an input image among a set of stored land-marks is performed by general purpose classifier trained to distin-guish among different landmark templates. In this work SupportVector Machine (SVM) (Cristianini & Shawe-Taylor, 2000) is used,a two-class classifier which constructs a separating hyperplane asthe decision boundary using the support vectors from the trainingsets.

4.2. Fashion shopping module

Due to the excellent properties of invariance to scale, rotationand point of view, the SIFT descriptors, which summarizes infor-mation about color, shape and texture, are widely used in objectrecognition. Nevertheless, the problem of clothes and accessories

recognition, requires to perform a discrimination based on colorsand contour shape, therefore the SIFT features are not the optimaldescriptors to describe the objects. In this work searches based oncolor, shape and a combination of both have been experimented.

Color moments (Stricker & Orengo, 1995) are popular colordescriptors for object recognition due to their simplicity, effective-ness and efficiency. The basis of color moments lays in the assump-tion that the distribution of colors in an image can be interpretedas a probability distribution: this distribution is characterized bya number of unique moments that can be used as features to iden-tify that image. According to the approach of Stricker and Orengo(1995) three central moments of an image’s color distribution foreach color channel (in our case RGB channels) are used: every im-age is therefore characterized by nine moments (three momentsfor each three color channels).

Given an image I of N pixels, let pij be the i-th color channel atthe j-th image pixel; the three color moments are:

� Mean: The average color value in the image

Ei ¼XN

j¼1

1N

pij ð1Þ

� Standard deviation: The square root of the variance of thedistribution:

ri ¼

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi1N

XN

j¼1

ðpij � EiÞ2 !vuut ð2Þ

� Skewness: The measure of the degree of asymmetry in thedistribution:

Page 6: SmartVisionApp: A framework for computer vision applications on mobile devices

1 Available at: http://dib.joanneum.at/cape/MPG-20/.

C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894 5889

si ¼

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi1N

XN

j¼1

ðpij � EiÞ3 !

3

vuut ð3Þ

In this application the input image is divided into 3 � 3 equal sub-regions and the color descriptors c eR9 are extracted separatelyfrom each region.

The distance between two images I1 and I2 is the sum of the dis-tance among their descriptors of each region. Several distancefunctions have been tested to calculate the distance between pairsof regions. As shown in Section 5.3 the best results were obtainedusing Bhattacharya distance. Bhattacharya distance is widely usedin pattern recognition and it is defined as:

Bðx; yÞ ¼XD

j¼1

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffixðjÞyðjÞ

qð4Þ

where x, y eRD are the feature vectors (D = 9 in this case).The distance value among pair of images can be used directly to

rank results according to their similarity to the searched object, orif the stored objects are classified (i.e. by color or shape), the dis-tance scores can be used to train a general purpose classifier forperforming the classification task. Results about both the applica-tions are reported in the experiments.

In the literature several shape descriptors have been proposedfor object recognition (Mingqiang, Kidiyo, & Jospeh, 2008), whichcan be roughly divided into three main categories:

� Contour-based methods and region-based methods, which useshape boundary points.� Space domain and transform domain, which match shape on

point basis (space domain) or on feature basis (feature domain).� Information preserving (IP) and non-information preserving

(NIP), which provide an accurate reconstruction off a shapefrom its descriptor (IP) or just a partial ambiguous reconstruc-tion (NIP).

In this work the invariant moments (Hu, 1962) have been used,which are considered very popular among the region-based ones.The general form of a moment function mpq of order (p + q) of ashape region can be defined as:

Mpq ¼X

p

Xq

wpqðx; yÞf ðx; yÞ ð5Þ

where wpq is known as the moment weighting kernel and f ðx; yÞrepresents the shape region of an image of W � H pixels, where

f ðx;yÞ ¼¼ 1 inside the region¼ 0 outside the region for x 2 ½1 . . . W �; y 2 ½1 . . . H�

�ð6Þ

For shape region segmentation the active contour/snake model(Bresson & Esedogl, 2005) is used: it consists of evolving a contourin images toward the boundary objects. This approach can be seenas a special case of general technique of matching deformable mod-el to an image by means of energy minimization. The approachadopted in this paper is based on Active Contours Without Edges(ACWE) model (Chan & Vese, 2001), which detects boundaries ofobjects on the basis of homogeneous regions, differently from clas-sical models where large image gradients are employed.

The invariant moments are based on the theory of algebraicinvariants as the relative and absolute combinations of momentsthat are invariant with respect to scale, position and orientation.

The invariant features can be obtained using central moments,which can be defined as follows:

lpq ¼Z 1

�1

Z 1

�1ðx� �xÞqf ðx; �yÞdxdy p; q ¼ 0;1;2; . . . ð7Þ

where

�x ¼ m10

m00�y

m10

m00ð8Þ

The point �x; �y corresponds to the centroid of the image f ðx; yÞ. Thecentroid moment lpq is equivalent to mpq if its center has beenshifted to the centroid of the image: this is why the central mo-ments are invariant to image translations. To obtain also scaleinvariance, the normalized moments are used, defined as:

gpq ¼lpq

lc00

; c ¼ ðpþ qþ 2Þ2

; pþ q ¼ 2;3; . . . ð9Þ

In this work the seven invariant moments proposed by Hu (1962)are used for their properties of invariance to scaling, translationand rotation. The seven invariant moments for shape recognitionare based on normalized central moments and are defined asfollows:

/1 ¼ g20 þ g02

/2 ¼ ðg20 � g02Þ2 þ 4g2

11

/3 ¼ ðg30 � 3g12Þ2 þ ð3g21 � l03Þ

2

/4 ¼ ðg30 þ g12Þ2 þ ðg21 þ l03Þ

2

/5 ¼ ðg30 � 3g12Þðg30 þ g12Þ½ðg30 þ g12Þ2 � 3ðg21 � g03Þ

2�þ ð3g21 � g03Þ½3ðg30 þ g12Þ

2 � ðg21 þ g03Þ2�

/6¼ðg20�g02Þ½ðg30þg12Þ2�ðg21�g03Þ

2�4g11ðg30þg12Þðg21þg03Þ

/7 ¼ ðg21 � g03Þðg30 � g12Þ½ðg30 þ g12Þ2 � 3ðg21 � g03Þ

2�� ðg30 � 3g12Þðg21 � g03Þ½3ðg30 þ g12Þ

2 � ðg21 þ g03Þ2�

According to our experiments the similarity between two invariantmoments descriptors has been calculated using Bhattacharya dis-tance as in color moments case.

5. Experimental results

The experimental evaluation of the proposed system has beenconducted on four datasets: three well-known benchmarks and aself-collected dataset for landmark recognition and a self-collecteddataset of fashion accessories. In our experiments the computer vi-sion components of the system have been extensively tested toevaluate both the efficiency and effectiveness of the recognitionsystem.

5.1. Datasets

For landmark recognition the following four datasets have beenused:

� Mobile Phone Imagery Graz (MPG20)1 (Fritz et al., 2005): It con-tains 80 images (640 � 480 pixels) of 20 buildings, four views foreach building. Few samples from MPG20 are shown in Fig. 5.According to the original protocol, two images of each objecttaken by a viewpoint change of about ±30� of a similar distanceto the object are selected for training and the two additionalviews (of distinct distance and therefore significant scale change)for testing.

Page 7: SmartVisionApp: A framework for computer vision applications on mobile devices

Fig. 5. Samples from MPG20 dataset.

5890 C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894

� Caltech Building Dataset (Caltech)2 (Aly, Welinder, Munich, &Perona, 2009): It contains 250 images (1536 � 2048 pixels) of50 buildings around the Caltech campus. Five different imageswere taken for each building from different angles and distances.Due to computational issues the images of this dataset have beenresized to 480 � 640 pixels. Few samples from Caltech are shownin Fig. 6. According to Hedau et al. (2012), a fivefold cross valida-tion testing protocol has been used on this dataset.� Zurich Building Datasel (ZuBuD)3 (Shao, Svoboda, Ferrari, Tuy-

telaars, & Van Gool, 2003): it contains a training set of 1005images (480 � 640 pixels) from 201 Zurich city buildings, withfive images for each building, with different points of view. Dif-ferences among the views include the angle at which the pictureis taken, relatively small scaling effects and occlusions. TheZuBuD comes with a standardized query set, consisting of 115images of buildings occurring in the database: these images aretaken with a different camera under different conditions. Fewsamples from ZuBuD are shown in Fig. 7.� Italian Landmarks Dataset (ItaLa)4: It contains 1435 images (of

different sizes) from 41 famous Italian buildings. For each build-ing there are 35 images with different points of view, scaling orocclusions. Few samples from ItaLa are shown in Fig. 8. A fivefoldcross validation testing protocol have been used on this dataset.

2 Available at: http://vision.caltech.edu/malaa/datasets/caltech-buildings/.3 Available at: http://www.vision.ee.ethz.ch/showroom/zubud/.4 Available at: http://bias.csr.unibo.it/lumini/download/dataset/ItaLa.zip.

� For the evaluation of the fashion shopping module a self-col-lected dataset of fashion accessories has been used:� Fashion Accessories Dataset (FAD)5: It contains 132 images with

different colors and shapes. The images are labeled by colors (11classes) and shapes (7 classes) into classes with a different num-ber of objects per class. The combined labeling generates a joinedclassification into 42 non-empty classes. Few samples from FADare shown in Fig. 9. A twofold cross validation testing protocolhave been used on this dataset.

5.2. Experiments on landmark recognition

The Landmark recognition module contains many parameters(i.e. number of words, dimension of the dictionary, parameters ofthe SVM classifier, etc.) that have to be initialized at the beginningof the procedure itself. These arguments have been optimized onMPG20 dataset, using a 4-fold cross validation.

In Table 3 the recognition accuracy obtained in the four land-mark datasets is reported.

The results reported in Table 3 show that the proposed systemachieves a very good recognition performance in all the testeddatasets and the reported results are comparable with otherstate-of-the-art approaches. The training time is quite high (13 mfor the ‘‘ItaLa’’ dataset on a Intel i5-2500 3.30 GHz) but the searchtime is very low, so that the retrieval can be performed in real-time

5 Available at: http://bias.csr.unibo.it/lumini/download/dataset/fad.zip

Page 8: SmartVisionApp: A framework for computer vision applications on mobile devices

Fig. 6. Samples from Caltech dataset.

Fig. 7. Samples from ZuBuD dataset.

C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894 5891

Page 9: SmartVisionApp: A framework for computer vision applications on mobile devices

Fig. 8. Samples from ItaLa dataset.

Fig. 9. Samples from FAD dataset.

5892 C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894

Page 10: SmartVisionApp: A framework for computer vision applications on mobile devices

Table 3Recognition accuracy obtained on different datasets.

Accuracy Dataset

Method MPG20 (%) Calthech (%) ZuBuD (%) ItaLa

Proposed approach 95 96 100 92.50Redondi et al. (2012) – – 80 –Hedau et al. (2012) – 90 92 –Fritz et al. (2005) 97.5 – 93 –Takacs et al. (2008) – – 97 –

Table 4Accuracy obtained on different classification problems in the FAD dataset.

Accuracy Classification problem

Descriptor Distance/classifier

Color(%)

Shape(%)

Color&Shape(%)

Color&Invariantmoments

Bhattacharya 100 100 84

Euclidean 73 70 60Batt + SVM 100 100 92

SIFT Bhattacharya 100 99 93Euclidean 78 71 58Batt + SVM 100 100 96

Table 5AUC obtained on different classification problems in the FAD dataset.

AUC Classification problem

Descriptor Distance/classifier

Color Shape Color&Shape

Color&Invariantmoments

Bhattacharya 1 1 0.89

Euclidean 0.82 0.64 0.63Batt + SVM 1 1 0.95

SIFT Bhattacharya 1 0.98 0.92Euclidean 0.72 0.66 0.54Batt + SVM 1 1 0.95

C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894 5893

(about 3 s including the transfer time) on a dataset of 1459 imageslike ItaLa.

5.3. Experiments on fashion shopping search

For the Fashion shopping module no parameter optimizationhas been performed (the same parameter optimized on MPG20dataset are used), while the training of classifiers has been doneaccording to a twofold cross validation.

In Table 4 the accuracy obtained by the proposed approaches isreported for different classification task: color classification, shapeclassification or both. Color and shape descriptors are fused byweighed sum rule, after Zero-one normalization6 (Wu & Crestani,2006): the weighing factors are (1,0), (0,1), (0.5,0.5) respectivelyfor the three problems. ‘‘Batt + SVM’’ indicates the output score ofa SVM classifier trained using the Bhattacharya distances.

In Table 5 the area under the ROC curve (AUC) for the same clas-sification problem is reported. AUC is a scalar performance indica-tor, widely used in pattern classification, that can be interpreted asthe probability that the classifier will assign a higher score to a ran-domly picked couple of pattern of the same class rather than to arandomly picked couple of pattern of different classes.

6 All scores are normalized in the range of [0,1], with the minimal score mapped to0 and the maximal score to 1.

The experiments show that Color and Invariant moments haveperformance very similar to SIFT descriptors for this problem:the choice of using moments is therefore motivated by computa-tional considerations. The Bhattacharya distance reaches the bestperformance (also against other distances tested but not reportedhere for sake of space); the use of a trained classifier as SVM allowsa slight improvement, but in our opinion this does not compensatethe overhead of a training phase. As concerns the Color&Shapeclassification problem, the drop of performance is probably dueto the fact that several classes have a very low number of samples,therefore the classification is harder than the other two ones. Per-haps an ad hoc tuning of the weighing factors could improve theperformance.

6. Conclusions

In this paper a new framework for the development of com-puter vision applications in mobile devices is proposed; two prac-tical implementations have been tested: landmark recognitionand fashion shopping. With quick development of mobile devices,a large number of people already own smartphones. The SmartVi-sionApp system provides an attracting way to develop image-based searching application using images captured by mobilecameras.

The framework has been designed for general purpose applica-tions involving object recognition on the basis of visual, textual andspatial information. Differently to most of existing approaches oursystem performs search based on image similarity, without requir-ing GPS-coordinates. The effectiveness of the framework is testedin a landmark recognition module, a touristic application aimedat discovering information about monuments, and in a fashionshopping application, designed to perform similarity searches inthe context of clothes and accessories. Both applications allowcombining information of different nature on the basis of the userpreferences and grants two functionalities: image search and sys-tem knowledge base update. The computer vision modules havebeen extensively evaluated on several datasets: our experimentsdemonstrate that both components work well with medium-sizedatabases.

As a future work it is worth to mention the need to make thesystem more scalable to deal with larger databases. Several workshave faced the problem of reducing the length of SIFT featureswithout losing accuracy. The proposed application requires adhoc indexing approaches, to be inserted into the visual compo-nents, to improve the efficiency of the search. Another possible up-grade of this framework is the possibility of making available asinternal components some more general methods for image pre-processing, feature extraction and classification to be used for thedesign of the plug-in components. Finally the effectiveness andefficiency of the system under more case studies shall be testedand analyzed.

References

Aly, M., Welinder, P., Munich, M., & Perona, P. (2009). Towards automated largescale discovery of image families. In Second IEEE workshop on internet vision.Miami, Florida.

Bhattacharya, P., & Gavrilova, M. (2013). A survey of landmark recognition using thebag-of-words framework. In Intelligent computer graphics 2012 (pp. 243–263).New York: Springer.

Bresson, X., & Esedogl, S. (2005). Fast global minimization of the active contour/snake model. Journal of Mathematical Imaging and Vision, 28(2), 151–167.

Calderoni, L., Maio, D., & Palmieri, P. (2012). Location-aware mobile services for asmart city: Design, implementation and deployment. Journal of Theoretical andApplied Electronic Commerce Research, 7(3), 74–87.

Chan, T., & Vese, L. (2001). Active contours without edges. IEEE Transactions onImage Processing, 10(2), 266–277.

Chen, T., Wu, K., Yap, K., Li, Z., & Tsai, F. (2009). A survey on mobile landmarkrecognition for information retrieval. In Proceedings of 10th international

Page 11: SmartVisionApp: A framework for computer vision applications on mobile devices

5894 C. Casanova et al. / Expert Systems with Applications 40 (2013) 5884–5894

conference on mobile data management: systems, services and middleware (pp.626–630).

Cristianini, N., & Shawe-Taylor, J. (2000). An introduction to support vector machinesand other kernel-based learning methods. Cambridge University Press.

Csurka, G., Dance, C., Lixin, F., Willamowski, J., & Bray, C. (2004). Visualcategorization with bags of keypoints. In ECCV international workshop onstatistical learning in computer vision.

Fritz, G., Seifert, C., Kumar, M., & Paletta, L. (2005). Building detection from mobileimagery using informative SIFT descriptors. In Proceedings of SCIA (pp. 629–638).

Hedau, V., Sinha, S. N., Zitnick, C. L., & Szeliski, R. (2012). A memory efficientdiscriminative approach for location aided recognition. In Proceedings of the 1stworkshop on visual analysis and geo-localization of large-scale imagery.

Hu, M. (1962). Visual pattern recognition by moment invariant. IRE Transactions onInformation Theory, 8, 179–187.

Jégou, H., Douze, M., Schmid, C., & Pérez, P. (2010). Aggregating local descriptorsinto a compact image representation. In IEEE conference on computer vision andpattern recognition (pp. 3304–3311).

Jia, M., Fan, X., Xie, X., Li, M., & Ma, W.Y. (2006). Photo-to-search: Using cameraphones to inquire of the surrounding world. In 7th international conference onmobile data management (pp. 46).

Jiang, Y. (2010). Representations of keypoint-based semantic concept detection: Acomprehensive study. IEEE Transactions on Multimedia, 12(1), 42–53.

Lowe, D. (2004). Distinctive image features from scale-invariant keypoints.International Journal of Computer Vision, 60(2), 91–110.

Mingqiang, Y., Kidiyo, K., & Jospeh, R. (2008). A survey of shape feature extractiontechniques. In Pattern recognition techniques, technology and applications (pp.43–90). Vienna: Peng-Yeng Yin.

Morris, T. (2004). Computer vision and image processing. Palgrave Macmillan.Nowak, E., Jurie, F., & Triggs, B. (2006). Sampling strategies for bag-of-features

image classification. In Proceedings of the 9th European conference on computervision (pp. 490–503).

Redondi, A., Cesana, M., & Tagliasacchi, M. (2012). Low bitrate coding schemes forlocal image descriptors. In 14th international workshop on multimedia signalprocessing (pp. 124–129).

Schaffers, H., Komninos, N., & Pallot, M. (2012). Smart cities as innovationecosystems sustained by the future internet. FIREBALL, Technical Report.

Schindler, G., Brown, M., & Szeliski, R. (2007). City-scale location recognition. In IEEEconference on computer vision and pattern recognition (pp. 1–7).

Shao, H., Svoboda, T., Ferrari, V., Tuytelaars, T., & Van Gool, L. (2003). Fast indexingfor image retrieval based on local appearance with re-ranking. In Proceedings ofIEEE international conference on image processing (pp. 737–740).

Sivic, J., & Zisserman, A. (2003). Video Google: A text retrieval approach to objectmatching in videos. In International conference on computer vision (pp. 1470–1477).

Sivic, J., & Zisserman, A. (2009). Efficient visual search of videos cast as text retrieval.IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(4), 591–605.

Stricker, M., & Orengo, M. (1995). Similarity of color images. In Proceedings of SPIEstorage and retrieval for still image and video databases III (pp. 381–392). San Jose,CA, USA.

Takacs, G., Chandrasekhar, V., Gelfand, N., Xiong, Y., Chen, W., & Bismpigiannis, T.(2008). Outdoors augmented reality on mobile phone using loxel-based visualfeature organization. In 1st ACM international conference on multimediainformation retrieval (pp. 427–434).

Wu, S., & Crestani, F. (2006). Evaluating score normalization methods in data fusion.In Proceedings of the third Asia conference on information retrieval technology (pp.642–648).

Yap, K.-H., Chen, T., Li, Z., & Wu, K. (2010). A comparative study of mobile-basedlandmark recognition techniques. IEEE Intelligent Systems, 25(1), 48–57.

Yeh, T., Tollmar, K., & Darrell, T. (2004). Search the web with mobile imagesfor location recognition. Computer Vision and Pattern Recognition, 2, 1063–6919.

Zamir, A. R., & Shah, M. (2010). Accurate image localization based on Google mapsstreet view. In Proceedings of European conference of computer vision (pp.255268).

Zhang, J., Marszalek, M., Lazebnik, S., & Schmid, C. (2007). Local features and kernelsfor classification of texture and object categories: A comprehensive study.International Journal of Computer Vision, 77(2), 213–238.