26.03.2015 Views

INFOCOMP - Departamento de Ciência da Computação - Ufla

INFOCOMP - Departamento de Ciência da Computação - Ufla

INFOCOMP - Departamento de Ciência da Computação - Ufla

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ISSN 1807-4545<br />

<strong>INFOCOMP</strong><br />

Journal of Computer Science<br />

En<strong>de</strong>reço/Address<br />

<strong>INFOCOMP</strong> – Journal of Computer Science<br />

<strong>Departamento</strong> <strong>de</strong> Ciência <strong>da</strong> Computação<br />

Universi<strong>da</strong><strong>de</strong> Fe<strong>de</strong>ral <strong>de</strong> Lavras<br />

Caixa Postal 3037<br />

37200-000 – Lavras, MG, Brasil<br />

Tel./Fax: +55 35 3829-1545<br />

E-mail: infocomp@dcc.ufla.br<br />

http://www.dcc.ufla.br/infocomp<br />

Revista financia<strong>da</strong> com recursos <strong>da</strong> / Journal financed by<br />

Fun<strong>da</strong>ção <strong>de</strong> Amparo à Pesquisa do Estado <strong>de</strong> Minas Gerais<br />

<strong>INFOCOMP</strong> – Journal of Computer Science, Lavras, MG, Brazil, v.10, n.3, p. 01-55, September of 2011.


Ministério <strong>da</strong> Educação<br />

Ministro: Fernando Had<strong>da</strong>d<br />

Reitor: Antônio Nazareno Guimarães Men<strong>de</strong>s<br />

Vice-Reitor: José Roberto Soares Scolforo<br />

Pró-Reitora <strong>de</strong> Pesquisa: Édila Vilela <strong>de</strong> Resen<strong>de</strong> Von Pinho<br />

Ed. UFLA - Presi<strong>de</strong>nte do conselho editorial: Renato Paiva<br />

Volume 10, no. 3, September of 2011.<br />

Editorial Board<br />

Editor-in-Chief<br />

San<strong>de</strong>rson L. Gonzaga <strong>de</strong> Oliveira, UFLA, Brazil<br />

Advisory Editors<br />

Heitor Augustus Xavier Costa, UFLA, Brazil<br />

João Manuel R. S. Tavares, FEUP, Universi<strong>da</strong><strong>de</strong> do Porto, Portugal<br />

Muthu Ramachandran, Leeds Metropolitan University, UK<br />

Executive Editor<br />

Talles Heinfarth, UFLA, Brazil<br />

Horácio Hi<strong>de</strong>ki Yanasse, INPE, Brazil<br />

Luiz Henrique Andra<strong>de</strong> Correia, UFLA, Brazil<br />

Plínio <strong>de</strong> Sá Leitão Júnior, UFG, Brazil<br />

Scientific Editors<br />

Ab<strong>de</strong>lmalek Amine, Univ. Djillali Liabes - Sidi, Algeria Alceu Britto Jr., PUC-PR, Brazil<br />

Alessandra Alaniz Macedo, USP, Brazil<br />

Alessandro Marchetto, IRST, Italy<br />

Alice Kozakevicius, UFSM, Brazil<br />

An<strong>de</strong>rson <strong>de</strong> Rezen<strong>de</strong> Rocha, UNICAMP, Brazil<br />

André Luiz Zambal<strong>de</strong>, UFLA, Brazil<br />

André Vital Saú<strong>de</strong>, UFLA, Brazil<br />

Anita Fernan<strong>de</strong>s, UNIVALI, Brazil<br />

Antônio Maria Pereira <strong>de</strong> Resen<strong>de</strong>, UFLA, Brazil<br />

Antonio Pedro Timoszczuk, USP, Brazil<br />

António Ribeiro, European Commission, Italy<br />

Arnaldo <strong>de</strong> Albuquerque Araújo, UFMG, Brazil<br />

Aruna Ranganath, Bhoj Reddy Eng. Col. for Women, India<br />

Aswani Kumar Cherukuri, VIT University, India Ayyaswamy Kathirvel, KVCET, India<br />

Bruno <strong>de</strong> Oliveira Schnei<strong>de</strong>r, UFLA, Brazil<br />

Carlos <strong>de</strong> Castro Goulart, UFV, Brazil<br />

Claudio Cesar <strong>de</strong> Sá, UESC, Brazil<br />

Claudio R. Jung, UNISINOS, Brazil<br />

Daniel Mesquita, UFU, Brazil<br />

Deepak Dahiya, ITM Gurgaon, India<br />

Denilson Alve Pereira, UFLA, Brazil<br />

E<strong>de</strong>r Mateus Nunes Gonçalves, FURG, Brazil<br />

Elisa Huzita, UEM, Brazil<br />

Fábio Levy Siqueira, USP, Brazil<br />

Fatima L. S. Nunes, USP, Brazil<br />

Frank José Affonso, UNESP, Brazil<br />

Giovani Rubert Librelotto, UFSM, Brazil<br />

Heitor Augustus Xavier Costa, UFLA, Brazil<br />

Hernan Astudillo, Univ.Tec.Fe<strong>de</strong>rico Santa Maria, Chile Hyggo Almei<strong>da</strong>, UFCG, Brazil<br />

Il<strong>da</strong> Reis, FEUP, Universi<strong>da</strong><strong>de</strong> do Porto, Portugal Il<strong>de</strong>berto Aparecido Ro<strong>de</strong>llo, USP, Brazil<br />

João Carlos Giacomin, UFLA, Brazil<br />

João Manuel R. S. Tavares, FEUP, Univ. do Porto, Portugal<br />

Joaquim Quinteiro Uchôa, UFLA, Brazil<br />

Johan M. Sharif, Swansea University, UK<br />

Jorge Martinez-Gil, University of Malaga, Spain<br />

Jorge Rady Almei<strong>da</strong> Junior, USP, Brazil<br />

José Luís Braga, UFV, Brazil<br />

Leonardo Ribeiro, UFLA, Brazil<br />

Luciana A. F. Martimiano, UEM, Brazil<br />

Luciano José Senger, UEPG, Brazil<br />

Luiz Camolesi Jr., UNICAMP, Brazil<br />

Luiz Carlos Begosso, FEMA, Brazil<br />

Luiz Eduardo G. Martins, UNIMEP, Brazil<br />

Luiz Henrique Andra<strong>de</strong> Correia, UFLA, Brazil<br />

Marco Aurelio Gerosa, USP, Brazil<br />

Marcos A. Cavenaghi, UNESP, Brazil<br />

Maria Istela Cagnin, UFMS, Brazil<br />

Marinalva Dias Soares, INPE, Brazil<br />

Michel S. Soares, UFU, Brazil<br />

Muthu Ramachandran, Leeds Metropolitan Univ., UK<br />

Nan<strong>da</strong>mudi Vijaykumar, LAC-INPE, Brazil<br />

Omar Andres Carmona Cortes, CEFET/MA, Brazil<br />

O. P. Gupta, Punjab Agricultural University, India Plínio Sá Leitão Júnior, UFG, Brazil<br />

Priti Sajja, Sar<strong>da</strong>r Patel University, India<br />

Rajkumar Samanta, Megnad Saha Inst. of Tech., India<br />

Reghunadhan Rajesh, Bharathiar University, India Renato <strong>de</strong> Freitas Bulcão Neto, UFG, Brazil<br />

Ricardo Terra, UFMG, Brazil<br />

Ricardo <strong>da</strong> Silva Torres, UNICAMP, Brazil<br />

Rodrigo Fernan<strong>de</strong>s <strong>de</strong> Mello, USP, Brazil<br />

Roger Pizzato Nunes, UFPel, Brazil<br />

Rogéria Cristiane Gratão Souza, UNESP, Brazil<br />

Rosângela A. Delosso Penteado, UFSCar, Brazil<br />

San<strong>de</strong>rson Lincohn Gonzaga <strong>de</strong> Oliveira, UFLA, Brazil Udo Fritzke Jr., PUC Minas em Poços <strong>de</strong> Cal<strong>da</strong>s, Brazil<br />

Valter F. Avelino, USP, Brazil<br />

Valter Vieira <strong>de</strong> Camargo, UFSCar, Brazil<br />

Vitus S. W. Lam, Hong Kong University<br />

Wilian Soares Lacer<strong>da</strong>, UFLA, Brazil<br />

Technical staff: Ariana <strong>da</strong> Silva Laureado.<br />

In<strong>de</strong>xed in: INSPEC; Qualis-CAPES.<br />

<strong>INFOCOMP</strong> – Journal of Computer Science – v.10, n.3 (2011) – Lavras: Universi<strong>da</strong><strong>de</strong> Fe<strong>de</strong>ral<br />

<strong>de</strong> Lavras, 2011.<br />

Anual (1999 - 2003), Semestral (2004), Trimestral (2005 - )<br />

Sumários em Inglês<br />

ISSN 1807–4545<br />

1. Ciência <strong>da</strong> Computação I.Universi<strong>da</strong><strong>de</strong> Fe<strong>de</strong>ral <strong>de</strong> Lavras. II. <strong>Departamento</strong> <strong>de</strong> Ciência<br />

<strong>da</strong> Computação.<br />

Solicita-se permuta /Exchange <strong>de</strong>sired; tiragem /circulation: 250.


Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2<br />

Web mo<strong>de</strong>l<br />

REDOUANE ESBAI 1<br />

MOHAMMED ERRAMDANI 2<br />

SAMIR MBARKI 3<br />

IBTISSAM ARRASSEN 4<br />

ABDELOUAFI MEZIANE 5<br />

MIMOUN MOUSSAOUI 6<br />

MATSI Laboratory, EST<br />

Mohammed First University, Ouj<strong>da</strong>, Morocco<br />

1 es.redouane@gmail.com<br />

6 moussaoui@est.univ-ouj<strong>da</strong>.ac.ma<br />

Department of Management, EST<br />

Mohammed First University, Ouj<strong>da</strong>, Morocco<br />

2 mram<strong>da</strong>ni69@yahoo.co.uk<br />

Department of Computer Sciences, Faculty of Science<br />

Ibn Tofail University, Kenitra, BP 133, Morocco<br />

3 mbarkisamir@hotmail.com<br />

Department of Mathematics and Computer Sciences, Faculty of Science<br />

Mohammed First University, Ouj<strong>da</strong>, Morocco<br />

4 arrassen@yahoo.com<br />

5 ab<strong>de</strong>louafi_meziane@yahoo.fr<br />

Abstract. The continuing evolution of business needs and technology makes Web applications more <strong>de</strong>manding<br />

in terms of <strong>de</strong>velopment, maintenance, and management. To cope with this complexity, several<br />

frameworks have emerged. Given this diversity of solutions, the generation of a co<strong>de</strong> based on UML<br />

mo<strong>de</strong>ls has become important. This paper presents the application of the MDA (Mo<strong>de</strong>l Driven Architecture)<br />

to generate, from the UML mo<strong>de</strong>l, the Co<strong>de</strong> following the MVC2 pattern (Mo<strong>de</strong>l-View-Controller)<br />

using the stan<strong>da</strong>rd MOF 2.0 QVT (Meta-Object Facility 2.0 Query-View-Transformation) as a transformation<br />

language. This stan<strong>da</strong>rd <strong>de</strong>fines the meta-mo<strong>de</strong>l for the <strong>de</strong>velopment of mo<strong>de</strong>l transformation.<br />

The transformation rules <strong>de</strong>fined in this paper can generate, from the class diagram, an XML file containing<br />

the Actions, the Forms, and JSP pages. This file can be used to generate the necessary co<strong>de</strong> of a<br />

web application.<br />

Keywords: MDA, mo<strong>de</strong>l transformation, MVC 2, transformation rules, MOF 2.0 QVT, meta-mo<strong>de</strong>l,<br />

OCL.<br />

(Received January 11st, 2011 / Accepted July 16th, 2011)<br />

1 Introduction<br />

In recent years many organizations have begun to consi<strong>de</strong>r<br />

MDA as an approach to <strong>de</strong>sign and implement enterprise<br />

applications. The key principle of MDA is the<br />

use of mo<strong>de</strong>ls at different phases of application <strong>de</strong>velopment<br />

by implementing many transformations. These<br />

changes are present in MDA, and help transform a CIM<br />

(Computation In<strong>de</strong>pen<strong>de</strong>nt Mo<strong>de</strong>l) into a PIM (Platform<br />

In<strong>de</strong>pen<strong>de</strong>nt Mo<strong>de</strong>l) or to obtain a PSM (Platform<br />

Specific Mo<strong>de</strong>l) from a PIM.<br />

MVC2 is a programming scheme that takes into ac-<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 2<br />

count the entire architecture of a program. It categorizes<br />

the different types of objects that make up the application<br />

into three categories: The mo<strong>de</strong>l manages the<br />

behavior and <strong>da</strong>ta of the application domain, the view<br />

corresponding to the interface with which users interact,<br />

and the Controller that supports event management<br />

synchronization to up<strong>da</strong>te the mo<strong>de</strong>l. This pattern saves<br />

time for maintenance as well as upgrading and greater<br />

flexibility to organize the <strong>de</strong>velopment of different <strong>de</strong>velopers<br />

(in<strong>de</strong>pen<strong>de</strong>nt <strong>da</strong>ta, display and actions). Many<br />

frameworks that implement the MVC2 pattern have<br />

emerged; for instance: Struts [1], PureMVC [4], Gwittir<br />

[3], SpringMVC [5], Zend [6], ASP.NET MVC2 [2].<br />

Struts remains the most mature and highly trusted solution<br />

among <strong>de</strong>velopers.<br />

Mbarki and Erram<strong>da</strong>ni [26, 27], both source and target<br />

meta-mo<strong>de</strong>ls have been <strong>de</strong>veloped. The first corresponds<br />

to a specific PIM meta-mo<strong>de</strong>l class diagram, and<br />

the second is a PSM meta-mo<strong>de</strong>l for MVC2 web application.<br />

The <strong>de</strong>velopment was done via RSM (Rational<br />

Software Mo<strong>de</strong>ler) based on a programming approach.<br />

This means that programming transformations mo<strong>de</strong>ls<br />

was done in the same way as programming computer<br />

applications. This paper aims to rethink the work presented<br />

in [26, 27]. However, we <strong>de</strong>velop the transformation<br />

rules using the MOF 2.0 QVT stan<strong>da</strong>rd to generate<br />

an XML file which contains actions, forms and JSP<br />

pages used to produce the co<strong>de</strong> for the target application.<br />

The advantage of this stan<strong>da</strong>rd is the bidirectional<br />

execution of transformation rules.<br />

This paper is organized as follows: related works<br />

are presented in the second section, the third section <strong>de</strong>fines<br />

the MDA approach, and the fourth section presents<br />

the MVC2 mo<strong>de</strong>l and its implementation as a framework,<br />

Struts in this case. The transformation language<br />

MOF 2.0 QVT and the language of OCL constraints are<br />

the subject of the fifth section. In the sixth section, we<br />

present the UML and MVC2 meta-mo<strong>de</strong>ls. In the seventh<br />

section, we present the transformation rules using<br />

MOF 2.0 QVT from UML source mo<strong>de</strong>l to the MVC2<br />

target mo<strong>de</strong>l. The last section conclu<strong>de</strong>s this paper and<br />

presents some perspectives.<br />

2 Related Work<br />

A much relevant work on meta-mo<strong>de</strong>ling was completed<br />

in 2007 [22] in which the authors have <strong>de</strong>veloped<br />

a meta-mo<strong>de</strong>l for web needs. This meta-mo<strong>de</strong>l takes<br />

into account concepts such as usage cases. The authors<br />

have <strong>de</strong>veloped transformation rules, but the main purpose<br />

of this work was the use of this meta-mo<strong>de</strong>l as a<br />

CIM to turn it into a PIM and then to a PSM.<br />

Two other works followed the same logic and have<br />

been the subject of two works [20, 24]. A meta-mo<strong>de</strong>l<br />

for Ajax was <strong>de</strong>fined using AndroMDA tool. The generation<br />

of Ajax co<strong>de</strong> has been illustrated by an application<br />

CRUD (Create, Read, Up<strong>da</strong>te, and Delete) that<br />

manages people.<br />

Kraus, Knapp and Koch [25] show how to build<br />

JSP pages and JavaBeans using the UWE [31], (UMLbased<br />

Web Engineering) and the ATL transformation<br />

language [15].<br />

Nasir, Hamid and Hassan [30] have presented<br />

an approach to generate a co<strong>de</strong> for the .Net<br />

application Stu<strong>de</strong>nt Nomination Management<br />

System. The method used is WebML and the co<strong>de</strong><br />

was generated by applying the MDA approach, but the<br />

creation was not done according to the .Net MVC2<br />

logic.<br />

The work presented by Amen, Ab<strong>de</strong>laziz and Samir<br />

[13] aims at providing a generic approach to automate<br />

the translation of conceptual mo<strong>de</strong>ls’ integrity<br />

constraints to the relational context of the MDA approach.<br />

To do this, the authors proposed a transformational<br />

mo<strong>de</strong>l based on the UML meta-mo<strong>de</strong>l. The<br />

rules of that transformation are <strong>de</strong>scribed by the graphical<br />

notation of QVT-Relations language.<br />

Oberortner, Vasko and Dust<strong>da</strong>r [32] have examined<br />

the safety aspects. A meta-mo<strong>de</strong>l was <strong>de</strong>veloped to integrate<br />

the roles of users to access various pages of the<br />

Web application. Each page contains navigation rules<br />

and each rule contains a <strong>de</strong>cision (if, else if, else).<br />

Recently, Mbarki, Rahmouni and Erram<strong>da</strong>ni [28]<br />

were conducted to mo<strong>de</strong>l Web MVC2 generation using<br />

the ATL transformation language.<br />

This paper aims to rethink the work presented by<br />

Mbarki and Erram<strong>da</strong>ni [26, 27], by applying the stan<strong>da</strong>rd<br />

MOF 2.0 QVT to <strong>de</strong>velop the transformation rules<br />

aiming at generating the MVC2 target mo<strong>de</strong>l. It is actually<br />

the only work for reaching this goal.<br />

3 Mo<strong>de</strong>l Driven Architecture (MDA)<br />

In November 2000, OMG, a consortium of over 1 000<br />

companies, initiated the MDA approach. The key principle<br />

of MDA is the use of mo<strong>de</strong>ls at different phases<br />

of application <strong>de</strong>velopment. Specifically, MDA advocates<br />

the <strong>de</strong>velopment of requirements mo<strong>de</strong>ls (CIM),<br />

analysis and <strong>de</strong>sign (PIM) and co<strong>de</strong> (PSM).<br />

The MDA architecture [29] is divi<strong>de</strong>d into four layers.<br />

In the first layer, we find the stan<strong>da</strong>rd UML (Unified<br />

Mo<strong>de</strong>lling Language), MOF (Meta-Object Facility)<br />

and CWM (Common Warehouse Meta-mo<strong>de</strong>l). In the<br />

second layer, we find a stan<strong>da</strong>rd XMI (XML Meta<strong>da</strong>ta<br />

Interchange), which enables the dialogue between middlewares<br />

(Java, CORBA, .NET and web services). The<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 3<br />

third layer contains the services that manage events,<br />

security, directories and transactions. The last layer<br />

provi<strong>de</strong>s frameworks which are a<strong>da</strong>ptable to different<br />

types of applications namely Finance, Telecommunications,<br />

Transport, medicine, E-commerce and Manufacture,<br />

etc.).<br />

The major objective of MDA [16] is to <strong>de</strong>velop sustainable<br />

mo<strong>de</strong>ls; those mo<strong>de</strong>ls are in<strong>de</strong>pen<strong>de</strong>nt from the<br />

technical <strong>de</strong>tails of platforms implementation (Java EE,<br />

.Net, PHP or other), in or<strong>de</strong>r to enable the automatic<br />

generation of all co<strong>de</strong>s and applications leading to a significant<br />

gain in productivity. MDA inclu<strong>de</strong>s the <strong>de</strong>finition<br />

of several stan<strong>da</strong>rds, including UML [7], MOF [8]<br />

and XMI [9].<br />

4.1 The Struts framework<br />

The Struts project [1] is managed within the community<br />

of Apache Software Foun<strong>da</strong>tion among the Jakarta<br />

projects. The motivation of this project is to provi<strong>de</strong> the<br />

Java community with a framework based on the MVC2<br />

architectural pattern while using Java EE technologies<br />

stan<strong>da</strong>rd [19]: JSP / Servlet, JavaBeans, XML.<br />

However, Struts is not the only framework for managing<br />

the presentation layer. In<strong>de</strong>ed, other frameworks<br />

have been <strong>de</strong>signed for the same goal, but Struts is the<br />

most mature. The main advantage of Struts is the reduced<br />

complexity compared to other frameworks of the<br />

same <strong>de</strong>gree of power [27], for instance, PureMVC,<br />

Gwittir and WebWork.<br />

4 The MVC2 Pattern<br />

The Mo<strong>de</strong>l-View-Controller (MVC) architectural pattern<br />

is a wi<strong>de</strong>ly used software and was created in 1980<br />

by Xerox PARC for Smalltalk-80. Lately it has been<br />

recommen<strong>de</strong>d as a mo<strong>de</strong>l for Java EE by Sun. The<br />

mo<strong>de</strong>l also won strong popularity among PHP <strong>de</strong>velopers.<br />

The MVC pattern is a useful addition to <strong>de</strong>veloper<br />

tools, whatever the language used is.<br />

The MVC pattern is a type of Design Patterns in the<br />

Architectural Patterns category. It is simple<br />

and very useful, and can essentially build an application<br />

using three levels: mo<strong>de</strong>l, view and controller.<br />

Figure 1 shows the architecture of the MVC2 pattern.<br />

The main feature of this pattern is to be composed<br />

of a single Servlet control. This pattern distinguishes<br />

the business logic, server-si<strong>de</strong> processing and the display.<br />

Each component is reusable and replaceable.<br />

4.2 Architecture and functioning of Struts framework<br />

The structure of the Struts framework <strong>de</strong>rives from the<br />

MVC2 mo<strong>de</strong>l (see Figure 2). In this mo<strong>de</strong>l, there is a<br />

controller, views and access to the mo<strong>de</strong>l.<br />

Controller: The controller of the Struts framework<br />

is responsible for making the link between the view<br />

and mo<strong>de</strong>l. It receives all client requests and forwards<br />

them to specific actions. These correspon<strong>de</strong>nces<br />

(mapping) are <strong>de</strong>scribed in a configuration file called<br />

struts-config.xml.<br />

View: The view is a set of JSP pages. To facilitate<br />

construction, the Struts framework provi<strong>de</strong>s several tag<br />

libraries.<br />

Mo<strong>de</strong>l: According to the MVC2 pattern, the mo<strong>de</strong>l is<br />

in<strong>de</strong>pen<strong>de</strong>nt from the controller. The Struts framework<br />

does not impose any; instead, technological choice is<br />

up to the <strong>de</strong>veloper (JDBC, EJB, JDO, and XML), etc<br />

according to his needs.<br />

Figure 1: MVC2 Architecture<br />

Based on this mo<strong>de</strong>l many frameworks are <strong>de</strong>signed<br />

to help <strong>de</strong>velopers build the presentation layer of their<br />

web applications. In the Java community, the Jakarta<br />

Struts project is one of the best examples.<br />

Figure 2: Principle of operation of the Struts framework<br />

The interaction between the three components is<br />

managed by the main controller. In or<strong>de</strong>r to better to<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 4<br />

un<strong>de</strong>rstand the working of the framework, we retail the<br />

life cycle of a HTTP request, schematized in figure 2:<br />

1- The customer sends his HTTP request to the application.<br />

This request is taken in charge by the main<br />

controller, in the ActionServlet case;<br />

2- The request is redirected towards the a<strong>de</strong>quate controller;<br />

3- The chosen controller handle the request. A dialogue<br />

with business logic is started when necessary;<br />

4- The mo<strong>de</strong>l provi<strong>de</strong>s the requested <strong>da</strong>ta;<br />

QVT meta-mo<strong>de</strong>l expresses some structural correspon<strong>de</strong>nce<br />

rules between the source and target meta-mo<strong>de</strong>l<br />

of a transformation. This mo<strong>de</strong>l is a perennial and productive<br />

mo<strong>de</strong>l that is necessary to transform in or<strong>de</strong>r to<br />

execute the transformation on an execution platform.<br />

5- The main controller is notified about the result of the<br />

treatment. In case of success, <strong>da</strong>ta are encapsulated<br />

in the JavaBeans (ActionForm) and then transmitted<br />

to the JSP selected by the controller;<br />

Figure 3: Approach by Mo<strong>de</strong>ling<br />

6- The JSP constructs the answer according to the<br />

transmitted <strong>da</strong>ta;<br />

7- The answer is sent to the browser.<br />

5 The transformations of MDA mo<strong>de</strong>ls<br />

MDA establishes the links of traceability between the<br />

CIM, PIM and PSM mo<strong>de</strong>ls through to the execution of<br />

the mo<strong>de</strong>ls’ transformations.<br />

The mo<strong>de</strong>ls’ transformations recommen<strong>de</strong>d by<br />

MDA are essentially the CIM transformations to PIM<br />

and PIM transformations to PSM.<br />

5.1 Approach by mo<strong>de</strong>ling<br />

Currently, the mo<strong>de</strong>ls’ transformations can be written<br />

according to three approaches: The approach by Programming,<br />

the approach by Template and the approach<br />

by Mo<strong>de</strong>ling.<br />

The approach by Mo<strong>de</strong>ling is the one used in the<br />

present paper. It consists of applying concepts from<br />

mo<strong>de</strong>l engineering to mo<strong>de</strong>ls’ transformations themselves.<br />

The objective is mo<strong>de</strong>ling a transformation,<br />

to reach perennial and productive transformation mo<strong>de</strong>ls,<br />

and to express their in<strong>de</strong>pen<strong>de</strong>nce towards the platforms<br />

of execution. Consequently, OMG elaborated a<br />

stan<strong>da</strong>rd transformation language called MOF 2.0 QVT<br />

[11]. The advantage of the approach by mo<strong>de</strong>ling is the<br />

bidirectional execution of transformation rules. This aspect<br />

is useful for the synchronization, the consistency<br />

and the mo<strong>de</strong>ls reverse engineering [18].<br />

Figure 3 illustrates the approach by mo<strong>de</strong>ling. Mo<strong>de</strong>ls<br />

transformation is <strong>de</strong>fined as a mo<strong>de</strong>l structured according<br />

to MOF 2.0 QVT meta-mo<strong>de</strong>l. The MOF 2.0<br />

5.2 MOF 2.0 QVT<br />

Transformations mo<strong>de</strong>ls are at the heart of MDA, a<br />

stan<strong>da</strong>rd known as MOF 2.0 QVT being established to<br />

mo<strong>de</strong>l these changes. This stan<strong>da</strong>rd <strong>de</strong>fines the metamo<strong>de</strong>l<br />

for the <strong>de</strong>velopment of transformation mo<strong>de</strong>l.<br />

The QVT stan<strong>da</strong>rd has a hybrid character (<strong>de</strong>clarative<br />

/ imperative) in the sense that it is composed of three<br />

different transformation languages (see Figure 4).<br />

The <strong>de</strong>clarative part of QVT is <strong>de</strong>fined by<br />

Relations and Core languages, with different levels<br />

of abstraction. Relations are a user-oriented language<br />

for <strong>de</strong>fining transformations in a high level of<br />

abstraction. It has a syntax text and graphics. Core<br />

language forms the basic infrastructure for the <strong>de</strong>claration<br />

part; this is a technical language of lower level<br />

<strong>de</strong>termined by textual syntax. It is used to specify<br />

the semantics of Relations language in the form of a<br />

Relations2Core transformation. The <strong>de</strong>clarative vision<br />

comes through a combination of patterns, source and<br />

target si<strong>de</strong> to express the transformation.<br />

The imperative QVT component is supported by<br />

Operational Mappings language. The vision requires an<br />

explicit imperative navigation as well as an explicit creation<br />

of target mo<strong>de</strong>l elements. The Operational Mappings<br />

language extends the two <strong>de</strong>clarative languages<br />

of QVT, adding imperative constructs (sequence, selection,<br />

repetition), etc and constructs in OCL edge effect.<br />

The imperative style languages are better suited for<br />

complex transformations including a significant algorithm<br />

component. Compared to the <strong>de</strong>clarative style,<br />

they have the advantage of optional case management<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 5<br />

in a transformation. For this reason, we chose to use an<br />

imperative style language in this paper.<br />

Finally, QVT suggests a second extension mechanism<br />

for specifying transformations invoking the functionality<br />

of transformations implemented in an external<br />

language Black Box.<br />

• The parser is called and gets as input a text file<br />

containing a QVT co<strong>de</strong> (qvtCo<strong>de</strong> ).<br />

• The parser returns the mo<strong>de</strong>l conforming to the<br />

QVT metamo<strong>de</strong>l.<br />

• Then the returned mo<strong>de</strong>l is passed to the compiler.<br />

• Finally, we get a Java file implementing the transformation<br />

(javaFile).<br />

Figure 4: The QVT Structure<br />

This work uses the QVT-Operational mappings language<br />

implemented by SmartQVT [23]. SmartQVT<br />

is the first open source implementation of the QVT-<br />

Operational language. The tool comes as an Eclipse<br />

plug-in un<strong>de</strong>r EPL license running on top of EMF<br />

framework. This tool is <strong>de</strong>veloped by France Telecom<br />

R & D project partially fun<strong>de</strong>d by the European IST<br />

Mo<strong>de</strong>l Ware.<br />

SmartQVT is composed of 3 components:<br />

• QVT Editor: helps end users to write QVT specifications.<br />

• QVT Parser: converts the QVT concrete textual<br />

syntax into its corresponding representation in<br />

terms of the QVT metamo<strong>de</strong>l.<br />

• QVT Compiler: produces, from a QVT mo<strong>de</strong>l, a<br />

Java program on top of EMF generated APIs for<br />

executing the transformation. The input format is<br />

a QVT specification provi<strong>de</strong>d in XMI 2.0 in conformance<br />

with the QVT meta-mo<strong>de</strong>l.<br />

Figure 5: Transformation Scenario with SmartQVT tool<br />

In Figure 5, presents a scenario of minimal processing:<br />

5.3 OCL (Object Constraint Language)<br />

Object Constraint Language (OCL) is a formal language<br />

used to <strong>de</strong>scribe expressions on UML mo<strong>de</strong>ls.<br />

These expressions typically specify invariant conditions<br />

that must hold for the system being mo<strong>de</strong>led or queries<br />

over objects <strong>de</strong>scribed in a mo<strong>de</strong>l. Note that when the<br />

OCL expressions are evaluated, they do not have si<strong>de</strong><br />

effects. OCL expressions can be used to specify operations<br />

/ actions that, when executed, do alter the state<br />

of the system. UML mo<strong>de</strong>lers can use OCL to specify<br />

application-specific constraints in their mo<strong>de</strong>ls.<br />

Currently, several tools of OCL exist, including<br />

ATL [14] Dres<strong>de</strong>n OCL Toolkit [21], Eclipse MDT<br />

OCL [10] KMF [12], Ocle [17], etc.<br />

In MOF 2.0 QVT, OCL is exten<strong>de</strong>d to Imperative<br />

OCL as part of QVT Operational Mappings.<br />

Imperative OCL ad<strong>de</strong>d services to manipulate the system<br />

states (for example, to create and edit objects, links<br />

and variables) and some constructions of imperative<br />

programming languages (for example, loops and conditional<br />

execution). It is used in QVT Operational Mappings<br />

to specify the transformations.<br />

QVT <strong>de</strong>fines two ways of expressing mo<strong>de</strong>l transformations:<br />

<strong>de</strong>clarative and operational approaches.<br />

The <strong>de</strong>clarative approach is the Relations language<br />

where transformations between mo<strong>de</strong>ls are specified as<br />

a set of relationships that must hold for successful transformation.<br />

The operational approach allows either <strong>de</strong>fining<br />

transformations using a complete imperative approach<br />

or complementing the relational transformations with<br />

imperative operations, by implementing relationships.<br />

Imperative OCL adds imperative elements of OCL,<br />

which are commonly found in programming languages<br />

like Java. Its semantics are <strong>de</strong>fined in [11] by a mo<strong>de</strong>l<br />

of abstract syntax. The complete abstract syntax ImperativeOCL<br />

is shown in Figure 6.<br />

The most important aspect of the abstract syntax is<br />

that all expression classes must inherit OclExpression.<br />

OclExpression is the base class for all the conventional<br />

expressions of OCL. Therefore, Imperative Expressions<br />

can be used wherever there is OclExpressions.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 6<br />

Figure 8 illustrates the first part of the target metamo<strong>de</strong>l.<br />

This meta-mo<strong>de</strong>l is a simplified diagram of relational<br />

<strong>da</strong>tabases. It consists of several tables, themselves<br />

composed of typed columns.<br />

Figure 6: Imperative Expressions of ImperativeOCL<br />

6 The UML and MVC2 meta-mo<strong>de</strong>ls<br />

To <strong>de</strong>velop the algorithm of transformation between the<br />

source and target mo<strong>de</strong>l, we present in this section, the<br />

different meta-classes forming the UML source metamo<strong>de</strong>l<br />

and the MVC2 target meta-mo<strong>de</strong>l. The metamo<strong>de</strong>l<br />

source structure simplified UML mo<strong>de</strong>l based on<br />

a package containing the <strong>da</strong>ta types and classes. These<br />

classes contain properties typed and characterized by<br />

multiplicities (upper and lower). The classes contain<br />

operations with typed parameters. Figure 7 shows the<br />

source meta-mo<strong>de</strong>l:<br />

Figure 8: Simplified meta-mo<strong>de</strong>l of a relational <strong>da</strong>tabase<br />

Figure 9 illustrates the second part of the target<br />

meta-mo<strong>de</strong>l. This is the business mo<strong>de</strong>l of the application<br />

to be processed. In our case, we opted for components<br />

such as Beans. We recall that Struts does not<br />

provi<strong>de</strong> specific classes.<br />

Figure 7: Simplified UML Meta-mo<strong>de</strong>l<br />

Figure 9: Simplified meta-mo<strong>de</strong>l of a mo<strong>de</strong>lPackage<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 7<br />

Figure 10 illustrates the third part of the target metamo<strong>de</strong>l.<br />

This meta-mo<strong>de</strong>l illustrates the mo<strong>de</strong>ls that represent<br />

the display of the application. In this mo<strong>de</strong>l, the<br />

servlet calls the execute() method on the instance<br />

of the class action. It performs its processing and then<br />

calls the mapping.findForward() method with a<br />

return to the JSP page specified.<br />

7 The process of transforming UML source<br />

mo<strong>de</strong>l to MVC2 target mo<strong>de</strong>l (Struts)<br />

CRUD operations (Create, Read, Up<strong>da</strong>te, and Delete)<br />

are most commonly implemented in all systems. That<br />

is why we have taken into account in our transformation<br />

rules these types of transactions. In [26], it was implemented<br />

that read operation, however, our work aims to<br />

implement all CRUD operations.<br />

We first <strong>de</strong>veloped ECORE mo<strong>de</strong>ls corresponding<br />

to our source and target meta-mo<strong>de</strong>ls, and then we implemented<br />

the algorithm (see sub-section 7.1) using the<br />

transformation language QVT Operational Mappings.<br />

To vali<strong>da</strong>te our transformation rules, we conducted several<br />

tests. For example, we consi<strong>de</strong>red the class diagram<br />

(see Figure 12). After applying the transformation<br />

on the UML mo<strong>de</strong>l, composed by the classes Department,<br />

Employee and City (ville), we generated the<br />

target mo<strong>de</strong>l (see Figure 16).<br />

Figure 10: Simplified meta-mo<strong>de</strong>l of a viewPackage<br />

Figure 11 shows the fourth part of the target metamo<strong>de</strong>l.<br />

This meta-mo<strong>de</strong>l is the package controller. This<br />

meta-mo<strong>de</strong>l illustrates mo<strong>de</strong>ls that represent the controller<br />

application. The controller is responsible for receiving<br />

applications sent by the client, with the invocation<br />

of the class action. It, thus, interacts with the business<br />

mo<strong>de</strong>l and coordinates with the display by sending<br />

it to the client.<br />

Figure 11: Simplified meta-mo<strong>de</strong>l of a controllerPackage<br />

The works of Mbarki and Erram<strong>da</strong>ni [26, 27] contain<br />

more <strong>de</strong>tails related to this section topic.<br />

Figure 12: UML instance mo<strong>de</strong>l<br />

7.1 The transformation rules<br />

By source mo<strong>de</strong>l, we mean mo<strong>de</strong>l containing the<br />

various classes of our business mo<strong>de</strong>l. The elements of<br />

this mo<strong>de</strong>l are primarily classes.<br />

Main algorithm:<br />

input umlMo<strong>de</strong>l:UmlPackage<br />

output strutsMo<strong>de</strong>l<br />

:StrutsProjectPackage<br />

begin<br />

create StrutsProjectPackage struts<br />

create ViewPackage vp<br />

vp = transformationRuleOne(e)<br />

create ControllerPackage cp<br />

cp = transformationRuleTwo(e)<br />

link vp to struts<br />

link cp to struts<br />

return struts<br />

end<br />

function<br />

transformationRuleOne(e:Class)<br />

:ViewPackage<br />

begin<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 8<br />

create ViewPackage vp<br />

for each e ? source mo<strong>de</strong>l<br />

if e.methods.name ? ’remove’<br />

create JspPage page<br />

link page to vp<br />

end if<br />

end for<br />

return vp<br />

end<br />

function<br />

transformationRuleTwo(e:Class) :<br />

ControllerPackage<br />

begin<br />

create ControllerPackage cp<br />

create ActionMapping am<br />

for each page viewPackage<br />

link page to actionForward<br />

create actionForm<br />

create Action action<br />

create ActionForward actionForward<br />

actionForm.input=page<br />

actionForm.attribute=action<br />

link page to actionForward<br />

link actionForward to action<br />

put action in am<br />

end for<br />

link am to cp<br />

return cp<br />

end<br />

Figure 13 illustrates the first part of the transformation<br />

co<strong>de</strong> of UML source mo<strong>de</strong>l to the MVC2 target.<br />

The transformation uses as input a UML type<br />

mo<strong>de</strong>l, named umlMo<strong>de</strong>l, and as output a STRUTS type<br />

mo<strong>de</strong>l named strutsMo<strong>de</strong>l. The entry point of the transformation<br />

is the main method. This method makes the<br />

correspon<strong>de</strong>nce between all elements of type UmlPackage<br />

of the input mo<strong>de</strong>l and the elements of type StrutsProjectPackage<br />

output mo<strong>de</strong>l.<br />

The objective of the second part of this co<strong>de</strong> is to<br />

transform a UML package to Struts package, creating<br />

an item such View package and Controller package.<br />

It is to turn each class in UML package, into JSP<br />

in the View package, and into Action in the Controller<br />

package making sure to give names to different packages.<br />

Figure 14: The mapping class2view and Operation2JspPage<br />

The methods presented in Figure 14 means that each<br />

operation in a class corresponds to JSP page.<br />

Figure 15: The mapping class2action<br />

The method presented in Figure 15 means that each<br />

class corresponds to one or more actions as the name<br />

and type of operations which contains it.<br />

The co<strong>de</strong>s and mo<strong>de</strong>ls are publicly available<br />

online http://sites.google.com/site/<br />

uml2mvc/.<br />

Figure 13: The transformation co<strong>de</strong> UML2Strut<br />

7.2 Result<br />

Figure 16 shows the result after applying the transformation<br />

rules.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 9<br />

CreateXEndAction, Up<strong>da</strong>teXEndAction,<br />

where X should be replaced by City(Ville) by Department,<br />

and Employee. Operations for creation<br />

and up<strong>da</strong>te, add forms to enter new values. For<br />

this reason, we add CreateXEndAction and<br />

Up<strong>da</strong>teXEndAction.<br />

For each element, for example,<br />

DisplayDepartementAction contains two<br />

elements: the attribute element indicating<br />

the form entered in this action is the ActionForm<br />

DisplayDepartementForm, and<br />

Forwards element with forward attribute<br />

DisplayDepartementPage.jsp. The Action element<br />

DisplayVilleAction contains only one<br />

Forwards element with forward attribute DisplayVillePage.jsp.<br />

The remaining actions follow the same principle.<br />

Figure 16: Generated PSM MVC2 Web mo<strong>de</strong>l<br />

The first element in the generated PSM mo<strong>de</strong>l<br />

is: viewPackage that contains the nine JSPs, namely<br />

DisplayVillePage.jsp, DisplayDepartementPage.jsp,<br />

DisplayEmployePage.jsp, CreateVillePage.jsp, CreateDepartementPage.jsp,<br />

CreateEmployePage.jsp,<br />

Up<strong>da</strong>teVillePage.jsp, Up<strong>da</strong>teDepartementPage.jsp<br />

and Up<strong>da</strong>teEmployePage.jsp. Since the operation<br />

of the removal requires any form, we’ll go<br />

to the controllerPackage element, which contains<br />

a single element ActionMapping. The latter<br />

contains eighteen actions whose names are respectively<br />

DisplayXAction, CreateXAction,<br />

Up<strong>da</strong>teXAction, RemoveXAction,<br />

8 Conclusion and perspectives<br />

In this paper, we applied the MDA to generate the<br />

MVC2 co<strong>de</strong> web application based on UML class diagram.<br />

The purpose of our contribution is to rethink<br />

the works presented by Mbarki and Erram<strong>da</strong>ni [26, 27].<br />

However, the transformation rules were <strong>de</strong>veloped applying<br />

the approach by mo<strong>de</strong>ling and MOF 2.0 QVT, as<br />

transformation language, to browse the class diagram<br />

and generate, through these rules, an XML file containing<br />

all the actions, forms and JSP pages. This file can be<br />

used to produce the necessary co<strong>de</strong> to the target application.<br />

The transformation algorithm handles all CRUD<br />

operations. The advantage of this approach is the bidirectional<br />

execution of transformation rules.<br />

Moreover, this work can be complemented by advanced<br />

features of Web applications. For example, we<br />

can provi<strong>de</strong> some user interface as well as the ability<br />

to incorporate other features: the persistence of objects<br />

in relational <strong>da</strong>tabase (Hibernate) and <strong>de</strong>pen<strong>de</strong>ncy injection<br />

(Spring) to produce a complete web application<br />

according to the n-tier architecture. This is the subject<br />

of a work in finalization phase.<br />

References<br />

[1] Apache software foun<strong>da</strong>tion: The apache<br />

struts web application software framework.<br />

http://struts.apache.org.<br />

[2] Asp.net mvc site http://www.asp.net/mvc/.<br />

[3] Gwittir site http://co<strong>de</strong>.google.com/p/gwittir/.<br />

[4] Puremvc framework http://puremvc.org/.<br />

[5] Spring framework http://www.springsource.org/.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 10<br />

[6] Zend framework http://framework.zend.com/.<br />

[7] UML Infrastructure Final Adopted Specification,<br />

version 2.0, September 2003.<br />

http://www.omg.org/cgi-bin/doc?ptc/03-09-<br />

15.pdf.<br />

[8] Meta Object Facility (MOF), version 2.0, January<br />

2006. http://www.omg.org/spec/MOF/2.0/PDF/.<br />

[9] XML Meta<strong>da</strong>ta Interchange (XMI), version 2.1.1,<br />

December 2007. http://www.omg.org/spec/XMI/.<br />

[10] MDT-OCL-Team, MDT OCL, 2008.<br />

http://www.eclipse.org/mo<strong>de</strong>ling/mdt/?project=ocl.<br />

[11] Meta Object Facility 2.0 Query<br />

View Transformation (MOF 2.0<br />

QVT), Version 1.1, December 2009.<br />

http://www.omg.org/spec/QVT/1.1/Beta2/PDF/.<br />

[12] Akehurst, D. and Patrascoiu, O. The kent mo<strong>de</strong>ling<br />

framework (kmf). University of Kent, 2005.<br />

http://www.cs.kent.ac.uk/projects/ocl.<br />

[13] Ali, A. B. H., Ab<strong>de</strong>llatif, A., and Ahmed, S. B.<br />

Transformation <strong>de</strong>s contraintes d’intégrité - <strong>de</strong>s<br />

modèles conceptuels vers le relationnel. In IN-<br />

FORSID, pages 398–415, 2007.<br />

[14] Allilaire, F., Bézivin, J., Jouault, F., and Kurtev,<br />

I. Atl - eclipse support for mo<strong>de</strong>l transformation.<br />

In In Proceedings of the Eclipse Technology eXchange<br />

workshop (eTX) at the ECOOP 2006 Conference,<br />

2005.<br />

[15] Allilaire, F., Bézivin, J., Jouault, F., and Kurtev.,<br />

I. Atl: A mo<strong>de</strong>l transformation tool. Science<br />

of Computer Programming-Elsevier, 72:31–39,<br />

2008.<br />

[16] Blanc, X. MDA en action : Ingénierie logicielle<br />

guidée par les modèles. Eyrolles, 2005.<br />

[17] Chiorean, D. and OCLE-Team. Object constraint<br />

language environment 2.0., 2008.<br />

http://lci.cs.ubbcluj.ro/ocle/.<br />

[18] Czarnecki, K. and Helsen, S. Classification of<br />

mo<strong>de</strong>l transformation approaches. In In online<br />

proceedings of the 2nd OOPSLA’03 Workshop on<br />

Generative Techniques in the Context of MDA,<br />

October 2003.<br />

[19] Davis, M. Struts, an open-source MVC implementation<br />

: Manage complexity in large Web sites with<br />

this servlets and JSP framework. IBM, Feb 2001.<br />

http://www.ibm.com/<strong>de</strong>veloperworks/library/jstruts/.<br />

[20] Distante, D., Rossi, G., and Canfora, G. Mo<strong>de</strong>ling<br />

business processes in web applications: An analysis<br />

framework. In In Proceedings of the The 22nd<br />

Annual ACM Symposium on Applied Computing,<br />

page 1677.<br />

[21] Dres<strong>de</strong>n-OCL-Team. Dres<strong>de</strong>n OCL Toolkit, 2008.<br />

http://dres<strong>de</strong>n-ocl.sourceforge.net.<br />

[22] Escalona, M. J. and Koch, N. Metamo<strong>de</strong>ling the<br />

requirements of web systems. Lecture Notes in<br />

Business Information Processing, 1:267–282, August<br />

2007.<br />

[23] France Telecom. SmartQVT documentation,<br />

2007. http://smartqvt.elibel.tm.fr/doc/in<strong>de</strong>x.html.<br />

[24] Gharavi, V., Mesbah, A., and van Deursen, A.<br />

Mo<strong>de</strong>lling and generating ajax applications: A<br />

mo<strong>de</strong>l-driven approach. In Proceeding of the 7th<br />

International Workshop on Web-Oriented Software<br />

Technologies, page 38, New York, USA,<br />

2008.<br />

[25] Kraus, A., Knapp, A., and Koch, N. Mo<strong>de</strong>ldriven<br />

generation of web applications in uwe.<br />

In Proceeding of the 3rd International Workshop<br />

on Mo<strong>de</strong>l-Driven Web Engineering, CEUR-WS,<br />

2007.<br />

[26] Mbarki, S. and Erram<strong>da</strong>ni, M. Toward automatic<br />

generation of mvc2 web applications. InfoComp<br />

- Journal of Computer Science, 7(4):84–91, December<br />

2008.<br />

[27] Mbarki, S. and Erram<strong>da</strong>ni, M. Mo<strong>de</strong>l-driven<br />

transformations: From analysis to mvc 2 web<br />

mo<strong>de</strong>l. International Review on Computers and<br />

Software (I.RE.CO.S.), 4(5):612–620, September<br />

2009.<br />

[28] Mbarki, S., Rahmouni, M., and Erram<strong>da</strong>ni, M.<br />

Transformation atl pour la génération <strong>de</strong> modèles<br />

web mvc 2. In 10e Colloque Africain sur la<br />

Recherche en Informatique et en Mathématiques<br />

Appliquées (CARI), 2010.<br />

[29] Miller, J. and Mukerji, J. MDA Gui<strong>de</strong> Version<br />

1.0.1, 2003. http://www.omg.org/docs/omg/03-<br />

06-01.pdf.<br />

[30] Nasir, M., Hamid, S., and Hassan, H. Webml and<br />

.net architecture for <strong>de</strong>veloping stu<strong>de</strong>nts appointment<br />

management system. Journal of applied science,<br />

9(8):1432–1440, 2009.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


Redouane Esbai et al. Transformation by Mo<strong>de</strong>ling MOF 2.0 QVT: From UML to MVC2 Web mo<strong>de</strong>l 11<br />

[31] Nora, K. Transformations techniques in the<br />

mo<strong>de</strong>l-driven <strong>de</strong>velopment process of uwe. In<br />

Proceeding of the 2nd International Workshop<br />

Mo<strong>de</strong>l-Driven Web Engineering, page 3, Palo<br />

Alto, 2006.<br />

[32] Oberortner, E., Vasko, M., and Dust<strong>da</strong>r, S. Towards<br />

mo<strong>de</strong>ling role-based pageflow <strong>de</strong>finitions<br />

within web applications. In Proceeding of the 4th<br />

Mo<strong>de</strong>l Driven Web Engineering Workshop, 2008.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 01-11, September of 2011.


A MultiCriteria Group Decision Support System for Industrial<br />

Diagnosis<br />

HAMDADOU DJAMILA 1<br />

THÉRÈSE LIBOUREL 2<br />

1 University of Oran, Laboratory LIO<br />

Department of Computer Science<br />

P.O. Box 1524 - El Mnaouar- Algeria<br />

(dzham<strong>da</strong>doud)@yahoo.fr<br />

2 University of Montpellier II, Laboratory LIRMM<br />

libourel@lirmm.fr<br />

Abstract. The diagnosis is a research key element to improve business performance. However, the<br />

diagnosis methods do not possess a unique and universal aspect in a context where diagnosis diversity<br />

and complexity are increasing. Thus, there is, currently, no susceptible diagnosis method which ensures<br />

the relevance, efficiency and effectiveness of maintenance in all circumstances. The work presented in<br />

this article aims to eliminate or at least lessen the impact of unsuccessful attempts of the diagnosis tools<br />

<strong>de</strong>velopment on the good functioning of a company. The <strong>de</strong>velopment of the multicriteria group <strong>de</strong>cision<br />

support system for diagnosis assistance (DIAG-GDSS) is an answer to the problem; it is a collective<br />

<strong>de</strong>cision-making tool for the choice of the most relevant diagnosis method.<br />

On the basis of a set of criteria and diagnosis methods, carefully selected and implemented , the <strong>de</strong>veloped<br />

tool allows:<br />

• to assist <strong>de</strong>cision makers in maintenance, according to their preferences often conflicting, to adopt<br />

a diagnosis method;<br />

• to make a quick and efficient diagnosis using the <strong>de</strong>veloped methods.<br />

In or<strong>de</strong>r to meet this group <strong>de</strong>cision where different viewpoints are consi<strong>de</strong>red, we propose a multilateral<br />

negotiation protocol, coupled with a multicriteria method namely ELECTRE III. This protocol features<br />

a coordinator agent and a set of participating agents, trying to find a compromise that best meets all the<br />

<strong>de</strong>cision makers.<br />

Keywords: group <strong>de</strong>cision support system, multiCriteria analysis, diagnosis, multi agents system, negotiation<br />

protocol, ELECTRE III.<br />

(Received May 10tf, 2011 / Accepted July 16th, 2011)<br />

1 Introduction<br />

In maintenance field, we need to be able to prevent production<br />

inability, rather than seek to produce more. It is<br />

therefore to maintain the total stock of equipment used<br />

in production. Maintenance inclu<strong>de</strong>s the functions of<br />

<strong>de</strong>tection, interpretation and <strong>de</strong>cision performed by a<br />

diagnosis system which constitutes an important part of<br />

a maintenance system. In<strong>de</strong>ed, the problem of diagnosis<br />

is actually linked to that of maintenance. The latter<br />

involves various factors; they may be economic (cost<br />

of maintenance over the expected gain), human (skills,<br />

personnel training) or industrial (turf skills, industrial<br />

competition) which are difficult to assess.<br />

Nowa<strong>da</strong>ys, all manufacturers are interested in new technologies<br />

enabling them to improve diagnosis and enhance<br />

their competitiveness. In<strong>de</strong>ed, reducing commissioning<br />

time, optimizing uptime and the requirements<br />

of availability constitute common concerns to almost all<br />

sectors whether in transportation, aviation, space, energy,<br />

environment, food or health.<br />

Giving the important role of diagnosis in maintenance,<br />

the relevance of the diagnosis system is a factor affecting<br />

the relevance of a maintenance system. For this purpose,<br />

diagnosis methods are numerous: each of these<br />

methods aims to solve diagnosis problems differently<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 13<br />

and tries to meet users’ expectations in a better way.<br />

Faced with this plurality of methods, the choice of the<br />

diagnosis method the most relevant and suitable to the<br />

issue is a very complex problem. In this context, research<br />

on the topic of relevance of diagnosis methods<br />

for maintenance is largely motivated by the lack of tools.<br />

This is in or<strong>de</strong>r to compare these methods for optimization<br />

of maintenance that is penalized. Offering companies<br />

a way to select the diagnosis tool, for implementation<br />

or adoption, represents a significant financial gain<br />

in a competitive environment. Thus, ensuring to the<br />

company that the proposed tool is the most suitable requires<br />

putting in place means to i<strong>de</strong>ntify the needs for<br />

each <strong>de</strong>cision-maker according to a variety of criteria.<br />

The current study takes in account a problem related<br />

to investment in industrial maintenance. The proposed<br />

methodology ensures the <strong>de</strong>velopment of a Multicriteria<br />

collective <strong>de</strong>cision support system trying to bring<br />

a conscious, clear and rational solution for the problem<br />

of diagnosis methods choice in a multicriteria and multi<br />

participant’s context.<br />

In this research context, the proposed group <strong>de</strong>cision<br />

support system DIAG-GDSS uses the benefits of Multi<br />

Agents Systems (MAS) to represent the diversity of actors<br />

involved in the diagnosis <strong>de</strong>cision, their behaviors<br />

as well as interactions. They are very suitable for mo<strong>de</strong>ling<br />

complex entities which can cooperate, collaborate<br />

or negotiate to reach an agreement.<br />

We endow the module MAS by a negotiation protocol<br />

based on mediation. This protocol features a coordinator<br />

(initiator) agent which is responsible for the smooth<br />

conduct of negotiation and a set of participating agents.<br />

The agents represent the different entities impacted by<br />

the <strong>de</strong>cision in terms of diagnosis.<br />

Multicriteria analysis allows classifying the different diagnosis<br />

methods, according to their relevance, respecting<br />

different points of view, often conflicted, of the different<br />

<strong>de</strong>cision makers affected by the group <strong>de</strong>cision.<br />

The proposed interactive tool also allows an implementation<br />

of the diagnosis tool chosen after negotiation within<br />

the company which is the subject of study.<br />

After presenting some elements of reflection to introduce<br />

the context of our study and highlighting the problems<br />

associated with diagnosis systems, we propose in<br />

Section 2 a classification of the diagnosis methods. Section<br />

3 gives a quick preview on the studies of diagnosis<br />

and issues related to this topic. Our contribution is<br />

<strong>de</strong>scribed in its whole in Section 4 and Section 5 is <strong>de</strong>voted<br />

to a state of art of negotiation in Multi Agents<br />

System (MAS). Section 6 <strong>de</strong>scribes the proposed group<br />

<strong>de</strong>cision support system DIAG-GDSS and the MAS component<br />

is <strong>de</strong>scribed in <strong>de</strong>tail, in the same section. Section<br />

7 <strong>de</strong>als with the procedure of use of the proposed<br />

tool and Section 8 is <strong>de</strong>voted to the experimentation of<br />

this tool through an application on an industrial production<br />

process. This case study constitutes a first vali<strong>da</strong>tion<br />

step. Finally, we conclu<strong>de</strong> the paper, in Section 9,<br />

and give some perspectives.<br />

2 Classification of the Diagnosis Methods<br />

The interpretation of the term "diagnosis" has much significance<br />

according to the addressed field [31].<br />

AFNOR (Stan<strong>da</strong>rd NF X 60-010) <strong>de</strong>fines the diagnosis<br />

as the i<strong>de</strong>ntification of the probable cause(s) of failure<br />

(s) using a logical reasoning on the basis of a set of<br />

information which is obtained from an inspection, control<br />

or test.<br />

There is a great variety of diagnosis methods; some of<br />

them are specific and appropriate to the industrial sector.<br />

The selection of the most appropriate diagnosis<br />

method to a given industrial system can be done only<br />

after a census of the needs and the available knowledge.<br />

In this section, we present briefly the main methods<br />

which meet at least one of the diagnosis process<br />

functions: the <strong>de</strong>tection function, the localization function<br />

and the i<strong>de</strong>ntification function, classified mainly<br />

according to the type of the used knowledge [31].<br />

2.1 Methods of Diagnosis by Mo<strong>de</strong>ling<br />

These methods are foun<strong>de</strong>d either on equations governing<br />

the internal phenomena of the system or on cases reflecting<br />

the system functioning mo<strong>de</strong>s. The associated<br />

mo<strong>de</strong>ls require a thorough knowledge of the system operation,<br />

and gather mainly in three main families: physical<br />

mo<strong>de</strong>ls[7], meta-mo<strong>de</strong>ls (FMEA Method (Failure<br />

Mo<strong>de</strong> and Effects Analysis) , HAZOP method (HAZard<br />

and OPerability stydy), Ishikawa diagram, failures<br />

trees, events trees, . . . ) and macro-states graphs [5]<br />

(Petri Networks and Hid<strong>de</strong>n Markov Mo<strong>de</strong>ls).<br />

2.2 Diagnosis Methods by Data Analysis<br />

When knowledge over the system be diagnosed is not<br />

sufficient and the <strong>de</strong>velopment of a process knowledge<br />

mo<strong>de</strong>l is impossible, the use of methods based on <strong>da</strong>ta<br />

analysis can be consi<strong>de</strong>red. This is the case of probabilistic<br />

methods for predicting length of life, matching<br />

matrix, support vector machine (SVM), neural networks<br />

and pattern recognition, etc. The latter have been,<br />

successfully, used in the field of diagnosis [28] [9].<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 14<br />

2.3 Diagnosis Methods by Artificial Intelligence (AI)<br />

The diagnosis systems using artificial intelligence tools<br />

are <strong>de</strong>signed to formalize and to mo<strong>de</strong>l knowledge providing<br />

mechanisms to exploit them. Compared to other<br />

methods where a priori quantitative or qualitative knowledge<br />

about the process is required, in the methods of AI,<br />

a large amount of <strong>da</strong>ta stored on the functioning system<br />

(normal and during failures) is required. There are<br />

two main approaches: Probabilistic Mo<strong>de</strong>l-based approaches<br />

(Bayesian Networks) [16] and inference Mo<strong>de</strong>lbased<br />

approaches (Case Based Reasoning and Expert<br />

Systems).<br />

3 Related Research Works in Diagnosis<br />

A lot of great and innovational contributions in diagnosis<br />

have been published. We can quote in a non exhaustive<br />

way the work of Hernan<strong>de</strong>z [13] who worked<br />

out a diagnosis system by neural networks applied to<br />

the <strong>de</strong>tection of the automobile driver hypovigilance;<br />

Dubuisson [9], who worked on the theory of the diagnosis<br />

containing mo<strong>de</strong>ls, the diagnosis by pattern recognition,<br />

and the neural networks; Bellot [1] who tried<br />

out the Bayesian networks for the diagnosis applied to<br />

the Telemedicine, Bourouni [3] who <strong>de</strong>veloped an assistance<br />

tool of the maintenance diagnosis based on the<br />

dominant mo<strong>de</strong>s of failures by exploiting the approach<br />

expert system, Djebbar [8] who approached the diagnosis<br />

making of hepatic pathologies by using two approaches:<br />

the Case Based Reasoning and the Bayesian<br />

Networks.<br />

More recently, we find the works of Khemliche [17]<br />

and [20], who used the bondgraphs for the installation<br />

of diagnosis assistance tools. Theilliol [29] who exploited<br />

the methods of diagnosis containing mo<strong>de</strong>ls for<br />

the monitoring of industrial systems, Greziac [14] who<br />

implemented a new approach of "diagnosis machine"<br />

based on the execution of a structural mo<strong>de</strong>l called "Automatic<br />

Diagnosis", Kiener [18] who proposed an implementation<br />

of neural networks for the diagnosis on<br />

coprocessor; Sabeh [25] who <strong>de</strong>tailed the general principles<br />

of diagnosis systems in the case of the monitoring<br />

of the loop of gases in an overfed diesel engine with direct<br />

injection. Lastly, we can quote Chanthery [4] who<br />

chose an embarked architecture for the mo<strong>de</strong>ling and<br />

the integration of the active diagnosis.<br />

Various projects exist in the literature regarding the <strong>de</strong>cision<br />

support in diagnosis, we cite mainly the Project<br />

HEROS; its goal is to provi<strong>de</strong> doctors, participating to<br />

Multidisciplinary Consultation Meetings, a support system<br />

for group <strong>de</strong>cision making (GDSS : Group Decision<br />

Support System) to take diagnosis and therapeutic<br />

<strong>de</strong>cisions [21].<br />

4 Our Contribution<br />

The purpose of this study is to provi<strong>de</strong> a response to<br />

the performance of maintenance systems. Thus, in this<br />

paper, we propose a methodology to justify the profitability<br />

of a maintenance project and gui<strong>de</strong> the user in<br />

choosing the most relevant diagnosis method. The proposed<br />

tool DIAG-GDSS (DIAGnosis Group Decision<br />

Support System), on the basis of a multicriteria group<br />

<strong>de</strong>cision approach (collective), <strong>de</strong>termines the most appropriate<br />

method of diagnosis to be implemented at an<br />

industrial company which focuses mainly on the processing<br />

of semi-finished products into finished products.<br />

DIAG-GDSS takes into account the specific and divergent<br />

interests of the various <strong>de</strong>cision makers to reach an<br />

acceptable agreement.<br />

The main objective of this work is to offer the company<br />

a way to indicate the diagnosis method to be applied.<br />

Thus, each <strong>de</strong>cision maker must establish a ranking and<br />

a prioritization of the different diagnosis methods, according<br />

to their relevance, relatively to well <strong>de</strong>fined criteria,<br />

while respecting its preferences using the multi<br />

criteria method ELECTRE III [2]. The final choice<br />

of the diagnosis method, in this <strong>de</strong>cisional situation, is<br />

ma<strong>de</strong> after a negotiation process according to the protocol<br />

that we propose.<br />

In this version of our tool, we <strong>de</strong>veloped 10 diagnosis<br />

methods which enabled us to capitalize expert’s knowledge.<br />

Each method provi<strong>de</strong>s, by the adopted approach<br />

or the used step, more to the diagnosis methodology.<br />

5 Reaching Agreements in MAS: State of Art<br />

One of the major problems faced by multi-agent systems<br />

is that of reaching agreement in a particular problem,<br />

each agent is supposed having a preference on contracts<br />

or possible agreements. The agent then sends<br />

messages in or<strong>de</strong>r to reach an agreement that can arrange<br />

everyone. But the agents face a dilemma: on<br />

the one hand, they want to maximize their own utilities,<br />

and on the other hand may fail negotiation and<br />

miss the agreement that can satisfy everyone. In MAS,<br />

among the most used techniques to reach such agreements,<br />

there are mainly auctions [30], voting systems<br />

[26], negotiation [12], and argumentation [15].<br />

In MAS, negotiation is a key form of interaction that<br />

allows a group of agents to reach a mutual agreement<br />

regarding their beliefs, goals or plans. It is the predominant<br />

tool for solving conflicts of interests. Generally<br />

speaking, there are various protocols of negotiation in<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 15<br />

MAS applications, the most used ones are [30]: Monotonic<br />

Concession Protocol, One Step Protocol, Contractual<br />

protocols (the Contract Net Protocol, the Exten<strong>de</strong>d<br />

Contract Net Protocol).<br />

1. the coordinator agent (initiator or manager): is the<br />

agent responsible for managing the negotiation, modifying<br />

the contract and choosing the final elected<br />

resource.<br />

6 DIAG-GDSS Description<br />

The originality of our approach is due to the simultaneous<br />

use of a MAS and a DIAGNOSIS system. The<br />

literature offers few examples of this type of coupling.<br />

For simplicity, we choose a loose coupling (or weak<br />

coupling 1 ) between the two components which remain<br />

in<strong>de</strong>pen<strong>de</strong>nt and communicate only by exchanging <strong>da</strong>ta<br />

[10]. Thus, the features of the two systems are different.<br />

Let us <strong>de</strong>tail the two modules:<br />

2. the participant agents (contractors): these are agents<br />

involved in the; the goal of each agent is that its favorite<br />

resource is chosen.<br />

It is essential that participant agents go through a negotiation<br />

phase, according to a well-structured protocol, in<br />

or<strong>de</strong>r to reach a beneficial agreement to the group. The<br />

negotiation takes place between the coordinator agent<br />

and all the participant agents (this is a negotiation from<br />

1 to n agents). Figure (1) shows an overview of DIAG-<br />

GDSS.<br />

6.1 The Diagnosis Module<br />

The advocated approach is generic; the diagnosis vision<br />

is supported by the DIAGNOSIS Module. The<br />

latter, after i<strong>de</strong>ntifying the various diagnosis methods<br />

and the different criteria, provi<strong>de</strong>s the performance matrix<br />

using several evaluation methods and simulation<br />

functions. This matrix is injected into the MAS module<br />

and analyzed by the multicriteria analysis engine<br />

ELECTRE III in or<strong>de</strong>r to generate different preference<br />

vectors according to each <strong>de</strong>cision maker, then the MAS<br />

provi<strong>de</strong>s a negotiation process to reach an agreement.<br />

6.2 The MAS Module<br />

This component aims to represent the different actors<br />

which have their own objectives, <strong>de</strong>cision strategies and<br />

preferences.<br />

Multi Agent technology has, already, proved its worth<br />

in many areas. It is especially invited in the implementation<br />

of collective <strong>de</strong>cision-making (multi <strong>de</strong>cision<br />

makers) applications because of the facilities which are<br />

provi<strong>de</strong>d.<br />

For mo<strong>de</strong>ling preferences, we use techniques of multicriteria<br />

<strong>de</strong>cision support methodology. The latter allows<br />

the construction of appropriate tools and is able to replace<br />

a <strong>de</strong>cision maker on complex problems.<br />

We <strong>de</strong>legate to MAS, the selection of the elected resource<br />

according to a negotiation process; the chosen<br />

diagnosis method will be implemented. To cope with<br />

this group <strong>de</strong>cision, it is necessary to go through a negotiation<br />

procedure to reach a beneficial consensus. To<br />

this end, we endow the MAS with a negotiation protocol<br />

based on mediation involving two types of agents:<br />

1 The best known types of coupling two systems are: the tight coupling<br />

(or strong coupling), the loose coupling (or weak coupling), the<br />

cooperative direct coupling and the cooperative indirect coupling<br />

Figure 1: DIAG-GDSS: An overview<br />

6.2.1 Mo<strong>de</strong>ling Agents<br />

The agentification is an important aspect of a MAS <strong>de</strong>signing.<br />

It strongly influences the performance and efficiency<br />

of the system to solve a problem. In litterature,<br />

there are a multitu<strong>de</strong> of methodologies offering an important<br />

interest for MAS in an organizational perspective<br />

[10] as Gaia, voyelles, ingenias, Aalaadin, . . . .<br />

Our proposal, for the mo<strong>de</strong>ling agents, is based on the<br />

methodology Aalaadin [11] exploiting the concepts of<br />

agent, group and role to <strong>de</strong>fine a real organization.<br />

6.2.2 The Phases of Negotiation in the Proposed<br />

Protocol<br />

The current negotiation protocol is, largely, based on<br />

the Contract Net Protocol [6]. It is characterized by<br />

a series of messages exchanged between the coordinator<br />

agent and the participant agents. It proceeds in<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 16<br />

five phases: an initialization phase, a proposal phase,<br />

an evaluation phase, a modification phase and a final<br />

<strong>de</strong>cision phase.<br />

1. The initialization phase: this phase is synonymous<br />

of the beginning of the negotiation process.<br />

Participants are asked to express their preferences<br />

concerning the different resources. Each agent establishes<br />

a classification of resources (methods of<br />

diagnosis) from the best one (the most beneficial)<br />

to the worst one, according to a set of criteria by<br />

using the multicriteria method ELECTRE III [19].<br />

2. The proposal phase: during this phase, the coordinator<br />

agent proposes a <strong>de</strong>al to all the participants<br />

on a given resource. They will either accept or reject<br />

the contract with reference to their vector of<br />

preferences, previously constructed in the initialization<br />

phase.<br />

3. The evaluation phase: when the coordinator receives<br />

all the answers of the participants concerning<br />

the proposal of the contract, it accounts the<br />

number of the participant agents having accepted<br />

its proposal. If this number is greater than or equal<br />

to a given threshold, then the negotiation is successful.<br />

If not, he must carry out a modification of<br />

the <strong>de</strong>al.<br />

4. The modification phase: during this phase, the<br />

coordinator is brought to make a modification of<br />

the contract while taking as a starting point the<br />

proposals of the agents. It must establish a synthesis<br />

from what it has received during the evaluation<br />

phase and then returns to the proposal phase.<br />

5. The <strong>de</strong>cision phase: this is the last phase of the<br />

suggested protocol. It signifies the end of the negotiation<br />

process. A <strong>de</strong>cision is taken by the coordinator<br />

according to the participants answers concerning<br />

the proposals which it has ma<strong>de</strong>.<br />

6.3 Characteristics of the Proposed Protocol<br />

During the negotiation process, many fun<strong>da</strong>mental aspects<br />

must be taken into account, such as:<br />

• the language used by the agents to exchange information<br />

during the negotiation (primitives and<br />

strategies);<br />

• the objects of negotiation;<br />

• the strategies adopted by the different agents;<br />

• the cardinality of the negotiation.<br />

In what follows, we present the main characteristics of<br />

the proposed negotiation protocol.<br />

6.3.1 The objects of negotiation<br />

Resources are the objects of negotiation, they can be<br />

either personal or shared. In our case, they are common<br />

resources (the diagnosis methods).<br />

6.3.2 The cardinality of negotiation<br />

It is an important concept for the MAS. The question<br />

is how agents negotiate among themselves. Our protocol<br />

allows the coordinator to propose a <strong>de</strong>al to a set of<br />

participants; it is a negotiation from 1 to n agents. item<br />

6.3.3 The primitives of negotiation<br />

In or<strong>de</strong>r to lead a negotiation process to its term, it is<br />

necessary to <strong>de</strong>fine specific primitives to the coordinator<br />

and other specific primitives to the participants.<br />

1. Coordinator primitives: the messages sent by the<br />

coordinator are aimed at all the participant agents,<br />

three primitives of negotiation are associated with<br />

the coordinator:<br />

Request (): the coordinator sends a message to<br />

the participants in or<strong>de</strong>r to indicate the beginning<br />

of the negotiation process;<br />

Propose (): the coordinator proposes a contract to<br />

the participant agents concerning a given resource;<br />

Confirm (): the coordinator sends a message to all<br />

the agents informing them that the negotiation is a<br />

success and that the resource was found.<br />

2. Participant primitives: the messages sent by the<br />

participants are solely aimed to the initiator. The<br />

other participants are not informed of these messages.<br />

Three negotiation primitives are associated<br />

with the participant:<br />

Inform(): after establishing a storage of the resources<br />

from the best to the least good. Each participant<br />

indicates to the coordinator that it can make<br />

them a first proposal;<br />

Accept (): through this message, the participant<br />

answers the proposal of the <strong>de</strong>al ma<strong>de</strong> by the coordinator.<br />

Each participant indicates, by this message,<br />

to the initiator that it accepts the contract;<br />

Refuse (): the participant indicates to the coordinator<br />

that its proposition is refused. The <strong>de</strong>al can<br />

not be conclu<strong>de</strong>d in its current form and should be<br />

modified.<br />

In or<strong>de</strong>r to represent the interactions between the coordinator<br />

agent and the participant agents, we opt for the<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 17<br />

use of the UML sequences diagram, often used to <strong>de</strong>scribe<br />

the interaction of different agents.<br />

Figure (2) represents the various primitives associated<br />

with the different agents via an UML diagram.<br />

Figure 2: UML Sequences diagram of the proposed negotiation protocol<br />

6.3.4 The Agents Strategies<br />

The suggested protocol distinguishes two roles: coordinator<br />

and participant. The negotiation strategy is not<br />

the same; it differs according to the role of the agent.<br />

Thus, there are two types of strategies:<br />

1. the coordinator strategy allows it to modify a contract<br />

if the participants have not rather been numerous<br />

to accept it;<br />

2. the participants strategies allow them to establish<br />

their preferences, accept a contract or refuse it.<br />

• Participant Strategies: we associate with each<br />

participant agent three strategies:<br />

1. Strategy of establishing preferences: each<br />

participant must establish a classification of the resources<br />

from the best (the most beneficial) to the<br />

least good referring to a certain number of criteria.<br />

For that, it exploits the advantages offered by the<br />

multicriteria <strong>de</strong>cision making method ELECTRE<br />

III [23], [22]. When each participant has established<br />

its preference vector, it associates with each<br />

resource a row. The resource classified first will<br />

have a higher row representing the preference of<br />

the participant at the first round. This ranking is,<br />

each time, <strong>de</strong>cremented by 1 for the following resources.<br />

2. Strategy of acceptance: the negotiation can<br />

proceed in several rounds, until a compromise is<br />

found. In each new round, the participant receives<br />

a new proposal. If it corresponds to its preference<br />

at the round t, it accepts this proposal. Otherwise,<br />

it checks whether the proposition corresponds to<br />

one of an earlier preference. If it is the case, it accepts<br />

the contract indicating its actual preference.<br />

3. Strategy of refusal: when the participant receives<br />

a proposition which corresponds neither to<br />

its preference at round t, nor to other earlier preferences,<br />

it refuses it and makes against the proposal<br />

which corresponds to its preference at round t.<br />

• coordinator Strategy: we associate with the coordinator<br />

only one strategy used at the time of the<br />

modification phase.<br />

Strategy of modification: when the participants<br />

are not rather numerous to accept the coordinator’s<br />

proposal, the latter is obliged to modify its contract<br />

for the next round while taking as a starting<br />

point all the modifications sent by the participants<br />

at round t , in or<strong>de</strong>r to find a new possibility for<br />

the contract. For that, the coordinator associates a<br />

score SCORE(R i ) with each resource R i (i= 1,..<br />

n) which takes into account the weight of the participant<br />

agent as well as the ranking of the resource<br />

in the vector of preferences of this agent. As in the<br />

method of scorages [10], the resource which has<br />

obtained the highest score at round t, will be the<br />

winner resource and the coordinator will propose<br />

it in the new contract. This score is up<strong>da</strong>ted each<br />

time the participants have been less numerous to<br />

accept the contract. SCORE(R i ) is given by the<br />

following equation :<br />

SCORE(R i ) =<br />

m∑<br />

W EIGHT (participant[j])<br />

j=1<br />

∗ROW (R i , participant[j])<br />

– n, m: the number of resources and <strong>de</strong>cision<br />

makers respectively;<br />

– WEIGHT(participant [j]): to each participant<br />

j, we associate a different weight, since in reality,<br />

the Project Engineer, for example, does<br />

not have the same weight that the Finance responsible<br />

at the time of a group <strong>de</strong>cision out<br />

of diagnosis.<br />

– ROW (R i , participant[j]): the row associated<br />

with the resource (action) i by the par-<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 18<br />

ticipant j in its vector of preferences (sorting<br />

provi<strong>de</strong>d by ELECTRE III);<br />

7 DIAG-GDSS: Functional Architecture<br />

The procedure for using the tool DIAG-GDSS operates<br />

in two main phases: a phase of group <strong>de</strong>cision support<br />

and a phase of diagnosis (concretization of results).<br />

agents have access to the performances matrix managed<br />

by the diagnosis component to <strong>de</strong>termine their vector<br />

of preferences by exploiting the multicriteria method<br />

ELECTRE III. After several rounds of negotiation un<strong>de</strong>r<br />

the proposed protocol, the participant agents arrive<br />

to a consensus that satisfies all the concerned parties (or<br />

part of them) in the final agreement.<br />

7.1 The Phase of Group Decision Support<br />

This phase of the current approach corresponds to the<br />

structuration and exploitation of the <strong>de</strong>cisional mo<strong>de</strong>l.<br />

7.1.1 Structuring the Decisional Mo<strong>de</strong>l<br />

This phase aims to i<strong>de</strong>ntify the problem and the fun<strong>da</strong>mental<br />

choices on how to approach it. It aims, also, to<br />

formalize three basic elements of the <strong>de</strong>cisional situation:<br />

7.2 The Phase of Diagnosis<br />

This phase is essentially the result of acceptance, it inclu<strong>de</strong>s<br />

the implementation of the group <strong>de</strong>cision and the<br />

control of the solution. In this last phase, after introducing<br />

the <strong>da</strong>ta of the industrial process, we can carry out<br />

the diagnosis through the elected diagnosis method.The<br />

main phases of DIAG-GDSS are <strong>de</strong>signed in Figure (3)<br />

and Figure (4) summarizes how DIAG-GDSS operates.<br />

1. I<strong>de</strong>ntify actions (resources): the i<strong>de</strong>ntification<br />

of all the potential actions is a very significant step<br />

in any <strong>de</strong>cision support approach, especially when<br />

the multicriteria analysis method proceeds by partial<br />

aggregation. It is very important that the set<br />

of all the actions is complete because its modification<br />

during the analysis can cause a recurrence of<br />

multicriteria analysis.<br />

2. I<strong>de</strong>ntify criteria: the list of criteria obtained by<br />

aggregating the corresponding factors (sub-criteria)<br />

should be as complete as possible. These criteria<br />

must be related to constraints and objectives used<br />

in the generation activities. The family of the most<br />

relevant criteria must verify the conditions of exhaustivity,<br />

consistency and in<strong>de</strong>pen<strong>de</strong>nce [23].<br />

3. I<strong>de</strong>ntify actors (<strong>de</strong>cision makers): the concept<br />

of actor refers to a concrete entity, localized (in a<br />

context). It is a unity of individual or collective<br />

<strong>de</strong>cision, which can allocate resources, purposes<br />

and strategies 2 . The multiplicity of actors makes<br />

negotiation difficult since we have on one si<strong>de</strong> the<br />

strong actors with a significant power and on the<br />

other si<strong>de</strong> weak actors who have more difficulty<br />

<strong>de</strong>fending their interests.<br />

7.1.2 Exploiting the Decisional Mo<strong>de</strong>l<br />

In this phase, every actor will be mo<strong>de</strong>led as an agent<br />

to which is associated a weight expressing its importance<br />

and its authority scope in the group <strong>de</strong>cision. All<br />

Figure 3: DIAG-GDSS: Functional architecture<br />

2 We can i<strong>de</strong>ntify two main types of actors: individual and collective.<br />

Collective actors are groups or organizations.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 19<br />

8.2 Definition of Actions<br />

Potential actions 3 are all diagnosis methods which are<br />

susceptible to meet the goals of a diagnosis system for<br />

maintenance, while respecting the imposed constraints<br />

and un<strong>de</strong>rtaking a technical study of each method.<br />

The actions correspond to different diagnosis methods<br />

that we have implemented and must be negotiated in<br />

or<strong>de</strong>r to help the <strong>de</strong>cision makers to choose the method<br />

that will be maintained for diagnosis. This is by consi<strong>de</strong>ring<br />

a set of criteria and taking into account the subjectivity<br />

of the several actors implied in this project.<br />

In the present study, and given the invested area (the industrial<br />

diagnosis), we opted for the following methods:<br />

Act1:Mo<strong>de</strong>l-based Diagnosis, Act2:Pattern Recognition<br />

Method, Act3: Expert Systems, Act4: Neural Networks,<br />

Act5: Petri Networks, Act6: Markov Chains, Act 7:<br />

Failure Mo<strong>de</strong> and Effects Analysis (FMEA), Act 8: Failures<br />

Trees, Act 9: Bayesian Networks, Act 10: Case<br />

Based Reasoning.<br />

Figure 4: Functioning of DIAG-GDSS<br />

8 Case Study: Experimental Results<br />

The <strong>de</strong>velopment of a multi-agent module is a complex<br />

problem. Therefore, it is preferable to use an existing<br />

multi-agent platform that we a<strong>da</strong>pt to our needs. The<br />

modules MAS and Diagnosis communicate with each<br />

other through shared <strong>da</strong>ta.<br />

8.1 The addressed Problem<br />

The implementation of the proposed group <strong>de</strong>cision support<br />

process is accompanied by an application on a company<br />

test. The objective of this simulation exercise is to<br />

support the proposed methodology by a confrontation<br />

with the available tools and <strong>da</strong>ta. In addition, testing<br />

DIAG-GDSS on an existing case (with real <strong>da</strong>ta) allows<br />

the vali<strong>da</strong>tion of our proposal.<br />

The study carried out was tested on a production process<br />

of an Algerian company of steel industry "AN-<br />

ABIB". For the sake of efficiency, we chose the most<br />

critical equipment of this company. It is about a machine<br />

which, starting from a steel coil, gives "tubes".<br />

It ensures the operation of forming and welding. This<br />

enabled us to show the effectiveness of this type of tool<br />

in terms of availability and reduction of the downtime of<br />

the machines. The stages to be followed, are <strong>de</strong>scribed<br />

in the next sections.<br />

8.3 I<strong>de</strong>ntification of Criteria<br />

The i<strong>de</strong>ntification of criteria for choosing a diagnosis<br />

method must be based on the exhaustive list of constraints<br />

and objectives of the diagnosis system in maintenance.<br />

Setting goals is an essential step that allows<br />

<strong>de</strong>fining the most relevant criteria to our study, acceptance<br />

levels of the diagnosis results, and therefore the<br />

relevance of methods and tools.<br />

In<strong>de</strong>ed, a criterion is a translation of an objective or a<br />

portion of an objective (respectively a constraint) into a<br />

quantifiable element quantitatively or qualitatively.<br />

In the current study, choosing the most relevant diagnosis<br />

method, takes into account a family of criteria. To<br />

give our study genericity following the methodology of<br />

diagnosis aid, the criteria used in our study were <strong>de</strong>veloped<br />

using experts from the company [27]. These<br />

criteria are:<br />

• Crt 1: Response time<br />

• Crt 2: Measures variations robustness<br />

• Crt 3: Mo<strong>de</strong>ling errors robustness<br />

• Crt 4: Prediction capacity<br />

• Crt 5: Development cost<br />

• Crt 6: Accessibility level<br />

• Crt 7: Ease of knowledge exploit<br />

3 In the multicriteria <strong>de</strong>cision aid methodology, the action is a possible<br />

solution for the <strong>de</strong>cisional problem; it is synonym of the term<br />

resource in the MAS vocabulary.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 20<br />

• Crt 8: Complex systems a<strong>da</strong>ptation<br />

8.4 Evaluation of Performances<br />

We focus, in this section, on evaluating the performance<br />

of each possible and potential diagnosis method according<br />

to each criterion:<br />

• If the method performance is high, this method is<br />

preferred;<br />

• Performance evaluations can be performed with<br />

various methods: analytical formulas, measuring<br />

instruments, human experts, . . . .<br />

• If the evaluation criterion is not measurable by an<br />

analytical formula or is not objectively measurable,<br />

an evaluation or score can be performed on a scale<br />

or finite set of values.<br />

The <strong>de</strong>finition and assessment of the i<strong>de</strong>ntified criteria<br />

according to different actions generate the matrix of<br />

performance, illustrated in Figure (5). This matrix is<br />

managed by the diagnosis component.<br />

• Decision maker 5 : machinery manager (the person<br />

who manages the machines and gives its opinion<br />

on the consistency of diagnosis with the machinery<br />

operation )<br />

Each Decision maker is represented by an agent; the<br />

generation of agents is performed using the platform<br />

MAS JADE (JAVA). We attribute to each participant<br />

agent, a weight expressing its importance in the negotiation.<br />

The weights of various actors, reflecting a maximum<br />

of reality, are given in Figure (6).<br />

Figure 6: The weights of several agents<br />

Figure 5: The matrix of performances<br />

8.5 I<strong>de</strong>ntification of Decision Makers<br />

In this study, the different <strong>de</strong>cision makers involved in<br />

the group <strong>de</strong>cision are:<br />

• Decision maker 1: project Engineer<br />

• Decision maker 2: company Manager<br />

• Decision maker 3: finance responsible<br />

• Decision maker 4 : diagnostician exhibitor (the<br />

person offering the diagnosis service)<br />

8.6 Definition of Subjective Parameters<br />

Each agent will make its vector of preference where it<br />

classes resources from the best ones to the worst according<br />

to the i<strong>de</strong>ntified criteria. To achieve this goal, it uses<br />

the multicriteria analysis method ELECTRE III. To be<br />

conducted, this method introduces some subjective parameters.<br />

In the following, we show how DIAG-GDSS<br />

assigns values to these parameters.<br />

1. Weight: is a number ω j , {j = 1, 2, ..., m}, m <strong>de</strong>signates<br />

the number of criteria) assigned to each criterion,<br />

according to its importance regarding other<br />

criteria. It is not always easy for the <strong>de</strong>cision maker,<br />

to articulate the assessment of the relative importance<br />

of each criterion. To assign a value to this<br />

intra criteria parameter, we used the Saaty scale.<br />

The latter allows evaluating various criteria and<br />

or<strong>de</strong>ring them according to their relative importance.<br />

The scale of Saaty is based on a mathematical<br />

mo<strong>de</strong>l <strong>de</strong>veloped by Thomas Saaty [24].<br />

After comparing sequential pairs of criteria (each<br />

criterion is assessed on all the others in a series of<br />

comparisons), we ask the user to or<strong>de</strong>r on a scale<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 21<br />

from (-9 to 9) the relative importance of one criterion.<br />

2. Thresholds: In our study, thresholds of preference<br />

and indifference p j and q j on the criteria j , respectively,<br />

are chosen on the basis of values assigned to<br />

<strong>da</strong>ta uncertainties. For example for an uncertainty<br />

of 20:<br />

p j = 2 ∗ 20/100 ∗ max(i, k)[g j (a k ) − g j (a i )]<br />

q j = 20/100 ∗ max(i, k)[g j (a k ) − g j (a i )]<br />

Where<br />

g j (a i ): the performance of action a i according to<br />

criterion j.<br />

g j (a k ): the performance of action a k according to<br />

criterion j.<br />

The veto threshold ν j is also <strong>de</strong>termined by the values<br />

assigned to <strong>da</strong>ta uncertainties. For example for<br />

an uncertainty of 20, ν j is given by:<br />

ν j = 3 ∗ 20/100 ∗ max(i, k)[g j (a k ) − g j (a i )] ; q j<br />

< p j


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 22<br />

Figure 11: Simulation of the negotiation process<br />

Figure 10: Viewing exchanged messages during the negotiation process<br />

via the Sniffer of JADE<br />

vance of the chosen method according to the objectives<br />

to be achieved by each of them.<br />

Although the choice of the method, in some cases is<br />

predictable, in other cases it is more complex, involving<br />

multiple <strong>de</strong>cision makers with conflicting objectives<br />

and based on very heterogeneous criteria.<br />

The objective, we have pursued throughout this paper,<br />

is to propose a group <strong>de</strong>cision-support process for facilitating<br />

the choice of a diagnosis method through the<br />

integration of a multicriteria approach in a negotiation<br />

protocol implemented in a multi-agent system.<br />

Thus, we have initiated in the framework of <strong>de</strong>cision<br />

support in diagnosis a new approach combining multicriteria<br />

analysis with mo<strong>de</strong>ls based agents to treat the<br />

multiplicity and diversity of actors in a diagnosis project.<br />

Through this article, our effort has focused on the proposal<br />

of a multicriteria group <strong>de</strong>cision support system<br />

that meets a primary objective and a specific objective,<br />

respectively:<br />

• the representation of the multiplicity of <strong>de</strong>cision<br />

makers in maintenance, their diversity, their be-<br />

havior and their interaction in or<strong>de</strong>r to select the<br />

diagnosis method which is the most appropriate to<br />

the context of the company.<br />

• the <strong>de</strong>velopment of different approaches we have<br />

used to mo<strong>de</strong>l a system of diagnosis.<br />

An application in the industrial field has been proposed,<br />

and has served as a basis to <strong>de</strong>monstrate the feasibility<br />

of such an approach.<br />

To consoli<strong>da</strong>te the contribution of different diagnosis<br />

methods integrated into the tool DIAG-GDSS, we have<br />

<strong>de</strong>veloped a negotiation protocol incorporating a multicriteria<br />

analysis method, more specifically ELECTRE<br />

III. The latter allows each actor of maintenance, with<br />

its own preferences, to make a classification by level of<br />

relevance using different criteria.<br />

We end here by evoking the different perspectives of<br />

research that we plan to address in the future:<br />

• extending the mo<strong>de</strong>l of agents allowing them to<br />

change their goals according to new information<br />

they receive: <strong>de</strong>veloping a protocol of negotiation<br />

based on argumentation;<br />

• integrating other strategies of negotiation between<br />

different agents.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 23<br />

Acknowledgements<br />

This research is supported by the Algerian Ministry of<br />

High Education and Scientific Research MESRS. The<br />

title of research program " Diagnosis, Decision Support<br />

System and Human Interaction" . I am very grateful to<br />

all the members of LIRMM Laboratory (Montpellier II<br />

University) for the fruitful discussions about this type of<br />

research which has significantly contributed to improve<br />

the presentation of this work.<br />

References<br />

[1] Bellot, D. Fusion <strong>de</strong> données avec <strong>de</strong>s réseaux<br />

bayésiens pour la modélisation <strong>de</strong>s systèmes dynamiques<br />

et son application en télémé<strong>de</strong>cine. PhD<br />

thesis, Université Henri poincaré, Nancy, 2002.<br />

[9] Dubuisson, B. Diagnostic, Intelligence Artificielle<br />

et reconnaissance <strong>de</strong> formes. Edition Hermès<br />

Lavoisier, 2001.<br />

[10] Ferber, J. Les systèmes multi-agents, vers une intelligence<br />

collective. Inter Editions, 1995.<br />

[11] Ferber, J. and Gutknecht, O. A meta-mo<strong>de</strong>l<br />

for the analysis and <strong>de</strong>sign of organizations in<br />

multi-agent systems. International Conference<br />

on Multi-Agent Systems, ICMAS98, IEEE Press,<br />

1:128–135, 1998.<br />

[12] Grant, J., Kraus, S., and Perlis, D. A<br />

logic for characterizing multiple boun<strong>de</strong>d agents.<br />

Autonomous Agents and Multi-Agent Systems,<br />

3:351–387, 2000.<br />

[2] BenMena, S. Une solution informatisée à<br />

l’analyse <strong>de</strong> sensibilité d’electre iii. Biotechnology,<br />

Agronomy, Society and Environment, 5:31–<br />

35, 2001.<br />

[3] Bourouni, K. Développement d’un outil d’ai<strong>de</strong> au<br />

diagnostic <strong>de</strong> maintenance basé sur les mo<strong>de</strong>s <strong>de</strong><br />

défaillances dominants. PhD thesis, Université <strong>de</strong><br />

provence , France, 2005.<br />

[4] Chanthery, E. and Pencolé, Y. Modélisation et<br />

intégration du diagnostic actif <strong>da</strong>ns une architecture<br />

embarquée. Journal européen <strong>de</strong>s systèmes<br />

automatisés: Modélisation <strong>de</strong>s systèmes réactifs,<br />

43:789–809, 2009.<br />

[5] Combacau, M. Comman<strong>de</strong> et surveillance <strong>de</strong>s systèmes<br />

à événements discrets complexes: Application<br />

aux ateliers flexible. PhD thesis, Université<br />

<strong>de</strong> Paul Sabatier, Toulouse, 1991.<br />

[6] Davis, R. and Smith, R. Negotiation as a metaphor<br />

for distributed problem solving,. Distributed Artificial<br />

Intelligence, 20:63–109, 1983.<br />

[7] Didier, G. Modélisation et diagnostic <strong>de</strong> la machine<br />

asynchrone en présence <strong>de</strong> défaillances.<br />

PhD thesis, Université Henri poincaré, Nancy,<br />

2004.<br />

[8] Djebbar, A. and Merouani, H. Mocabban: A mo<strong>de</strong>lling<br />

case base by a bayesian network applied<br />

to the diagnosis of hepatic pathologies. International<br />

Conference on Computational Intelligence<br />

for Mo<strong>de</strong>lling, Control and Automation, 1:678 –<br />

685, 2005.<br />

[13] Gress, N. H. Un système <strong>de</strong> diagnostic par<br />

réseaux <strong>de</strong> neurones et statistiques: App lication à<br />

la détection d’hypovigilance du conducteur automobile.<br />

PhD thesis, Université <strong>de</strong> Toulouse, 1998.<br />

[14] Greziac, F., editor. Diagnostic Automatique :une<br />

nouvelle approche <strong>de</strong> diagnostic machine basée<br />

sur l’exécution d’un modèle structurel. Journée<br />

SEE-AAI, GDRMACS-S3, Les nouveaux outils<br />

<strong>de</strong> diagnostic <strong>da</strong>ns les processus industriels : les<br />

clés <strong>de</strong> la compétitivité, 2008.<br />

[15] Ham<strong>da</strong>dou, D. Un Modèle d’Ai<strong>de</strong> à la Décision en<br />

Aménagement du Territoire, une Approche Multicritère<br />

et une Approche <strong>de</strong> Négociation. PhD thesis,<br />

Université d’Oran, Algérie, 2008.<br />

[16] Jonquières, S. Application <strong>de</strong>s réseaux bayésiens<br />

à la reconnaissance active d’objets 3D: contribution<br />

à la saisie d’objets. PhD thesis, Université <strong>de</strong><br />

Toulouse, 2000.<br />

[17] Khemliche, M., Bouamama, B. O., and Haffaf,<br />

H. Sensor placement for component diagnosability<br />

using bond graph. Sensor and Actuators,<br />

132:547–556, 2006.<br />

[18] Kiener, P. Implémentation <strong>de</strong> réseaux <strong>de</strong> neurones<br />

pour le diagnostic sur co-processeur. In Actes <strong>de</strong> la<br />

journée SEE-AAI, GDRMACS-S3, Les nouveaux<br />

outils <strong>de</strong> diagnostic <strong>da</strong>ns les processus industriels<br />

: les clés <strong>de</strong> la compétitivité, 2008.<br />

[19] Maystre, L. and Simos, J. P. J. Métho<strong>de</strong>s multicritères<br />

Electre. Edition Presses Polytechniques<br />

et Universitaires Roman<strong>de</strong>s, 1994.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Ham<strong>da</strong>dou Djamila and Thérèse Libourel A MultiCriteria Group Decision Support System for Industrial Diagnosis 24<br />

[20] Merzouki, R., Djeziri, K. M. A., and Ould-<br />

Bouamama, B. Fault <strong>de</strong>tection in mechatronics<br />

system. MECHATRONICS IFAC, 17:299–310,<br />

2007.<br />

[21] Morel-Wascat, C. Projet rnts. Technical report,<br />

Réseau National <strong>de</strong>s Technologies pour la Santé:<br />

HEROS, Décembre 2002 - Juin 2004.<br />

[22] Roy, B. Decision-aid and <strong>de</strong>cision-making. European<br />

Journal of Operational Research, 45:324–<br />

331, 1990.<br />

[23] Roy, B. The outranking approach and the foun<strong>da</strong>tions<br />

of electre methods. Theory and Decision,<br />

31:49–73, 1991.<br />

[24] Saaty, L. Decision-making with the ahp: Why<br />

is the principal eigenvector necessary. European<br />

Journal of Operational Research, 145:85–<br />

91, 2003.<br />

[25] Sabeh, Z., Ragot, J., and Maquin, D. Modélisation<br />

et surveillance <strong>de</strong> la boucle <strong>de</strong>s gaz <strong>da</strong>ns<br />

un moteur diesel suralimenté à injection directe.<br />

principes généraux du diagnostic <strong>de</strong> systèmes. In<br />

Actes <strong>de</strong> la journée SEE-AAI, GDRMACS-S3, Les<br />

nouveaux outils <strong>de</strong> diagnostic <strong>da</strong>ns les processus<br />

industriels : les clés <strong>de</strong> la compétitivité, 2008.<br />

[26] Sandholm, T. Negociation among self-interessted<br />

computationally limited agents. PhD thesis, Univeristy<br />

of Massachusetts, 1996.<br />

[27] Sénéchal, O. and Tahon, C. A mo<strong>de</strong>lling approach<br />

for production costing and continuous improvement<br />

of manufacturing processes. Production<br />

Planning and Control Journal, 8:731–742,<br />

1997.<br />

[28] Thairrault, Y. Détection et isolation <strong>de</strong> défauts par<br />

analyse en composantes principales robuste. PhD<br />

thesis, Université <strong>de</strong> Nancy, 2006.<br />

[29] Theilliol, D. and Aubrun, C. Surveillance <strong>de</strong> systèmes<br />

industriels fondée sur les métho<strong>de</strong>s <strong>de</strong> diagnostic<br />

à base <strong>de</strong> modèles,. In Actes <strong>de</strong> la journée<br />

SEE-AAI, GDRMACS-S3, Les nouveaux outils <strong>de</strong><br />

diagnostic <strong>da</strong>ns les processus industriels : les clés<br />

<strong>de</strong> la compétitivité, 2008.<br />

[31] Zwingelstein, G. Diagnostic <strong>de</strong>s défaillances:<br />

théorie et pratique pour les systèmes industriels.<br />

Edition Hermès, 1995.<br />

[30] Verrons, M. Un modèle général <strong>de</strong> négociation <strong>de</strong><br />

contrats entre agents. PhD thesis, Université <strong>de</strong><br />

Lille, 2004.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 12-24, September of 2011.


Digital Image Watermarking: A Review of SVD, DCT and DWT<br />

Based Approaches<br />

DINESH KUMAR 1<br />

VIJAY CHAHAR 2<br />

1 CSE Department, GJUS&T, Hisar, Haryana, INDIA<br />

2 CSE Department, JCDMCOE, Sirsa, Haryana, INDIA<br />

1 dinesh_chutani@yahoo.com<br />

2 vijaykumarchahar@gmail.com<br />

Abstract. This paper presents digital image watermarking and review of five recently proposed approaches.<br />

These approaches are based on Singular Value Decomposition (SVD), Discrete Wavelet Transform<br />

(DWT) and Discrete Cosine Transform (DCT). The approaches inclu<strong>de</strong> watermarking schemes<br />

based on SVD and DWT or DCT, that modify the singular values of four bands (<strong>da</strong>ta sets), <strong>de</strong>rived from<br />

the cover image using transform, with the singular values of watermark. We <strong>de</strong>scribe all the approaches<br />

pointing out their strengths and weaknesses. We further suggest an extension to the existing schemes. In<br />

the proposed work, we first <strong>de</strong>compose the cover image into bands (<strong>da</strong>ta sets) using DWT. These <strong>da</strong>ta<br />

sets are then divi<strong>de</strong>d into non-overlapping blocks. The singular values of each block are finally modified<br />

in a controlled manner using the singular values of watermark matrix. The partitioning of the <strong>da</strong>ta sets<br />

into non overlapping blocks and subsequent modification of singular values of each block make the watermark<br />

more robust against the various attacks as the results reveal. An experimental comparison with<br />

the existing schemes has also been carried out.<br />

Keywords: watermarking, discrete wavelet transform, singular value <strong>de</strong>composition, discrete cosine<br />

transform.<br />

(Received January 19th, 2011 / Accepted July 16th, 2011)<br />

1 Introduction<br />

We are living in information-oriented society. The evolution<br />

of fourth generation of mobile communication<br />

together with Internet and wireless LAN has ma<strong>de</strong> it<br />

very easy and in fact acted as a highway for large number<br />

of services such as e-commerce, multimedia communication,<br />

online air reservation and services, e-books<br />

etc. There is dissemination of lot of information which<br />

can be in various forms such as text, image, audio or<br />

vi<strong>de</strong>o. Most of the information is distributed as digital<br />

signals. Digitization of <strong>da</strong>ta has undoubtedly enabled<br />

reliable, faster and efficient storage, transfer and processing<br />

of digital <strong>da</strong>ta [12]. Consequently it has lead<br />

to illegal production and distribution of <strong>da</strong>ta and hence<br />

a threat to the authenticity and copyright of the information.<br />

Copyright protection of digital <strong>da</strong>ta is of great<br />

concern in such a scenario [22, 33].<br />

Cryptography and steganography are the two basic<br />

among the various <strong>da</strong>ta hiding techniques. These techniques<br />

can help us protect the multimedia <strong>da</strong>ta against<br />

illegal distribution [6]. The former <strong>de</strong>als with encryption<br />

and <strong>de</strong>cryption of <strong>da</strong>ta, with the help of a key, before<br />

transmission and after reception respectively. The<br />

latter constitutes embedding at the sen<strong>de</strong>r’s end and extraction<br />

of the <strong>da</strong>ta at the receiver’s end. Watermarking<br />

is a concept that has been <strong>de</strong>rived from steganography.<br />

The process of watermarking consists of three steps;<br />

watermark signal, embedding of watermark signal into<br />

<strong>da</strong>ta to yield watermarked <strong>da</strong>ta and the third step is <strong>de</strong>tection<br />

to verify its presence. Watermark signal may<br />

either be a number sequence or an image. There is a<br />

large number of watermarking techniques in the literature<br />

[29].<br />

There are many ways to classify the watermarking techniques.<br />

The watermark can be embed<strong>de</strong>d in spatial<br />

domain or in frequency domain [2, 20]. Frequency<br />

domain techniques are more robust than spatial domain<br />

as reported in literature [27]. Some popular frequency<br />

domains used are Discrete Cosine Transform<br />

(DCT), Discrete Fourier Transform (DFT) and Discrete<br />

Wavelet Transform (DWT) etc. The main properties<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 26<br />

of watermark are robustness, fi<strong>de</strong>lity, computational<br />

cost and false positive rate [11, 28]. Literature reports<br />

several watermarking techniques that have been <strong>de</strong>veloped<br />

by using SVD alone or along with DWT or DCT<br />

[3, 4, 7, 8, 18, 23, 24, 34].<br />

In this study, we review five of the recently proposed<br />

approaches for watermarking and discuss their relative<br />

strengths and weaknesses. These approaches are:<br />

an SVD based watermarking scheme by Liu and Tan<br />

[25], block-by-block SVD based image watermarking<br />

scheme by Ghazy et al. [15, 16], DWT-SVD domain<br />

image watermarking by Ganic and Eskicioglu<br />

[17], SVD-DCT based image watermarking by Rafizul<br />

Haque [21], a hybrid SVD and Wavelet based image<br />

watermarking by Majum<strong>de</strong>r et al. [26]. This paper has<br />

been divi<strong>de</strong>d into 5 sections. Section 2 briefly explains<br />

these techniques along with their strengths and weaknesses.<br />

Section 3 proposes an improvement in DWT-<br />

SVD based scheme. The next section 4 covers experimental<br />

results and discussions. The conclusions have<br />

been drawn in section 5.<br />

1.1 SVD, DCT and DWT Basics<br />

SVD is a numerical analysis tool for matrices, which<br />

give minimum least square error. The stability of singular<br />

values and the representation of intrinsic algebraic<br />

image properties by these values make SVD the one<br />

of the wi<strong>de</strong>ly used methods in image processing. The<br />

DCT is a technique for converting a signal into elementary<br />

frequency components. It represents an image as<br />

a sum of sinusoids of varying magnitu<strong>de</strong>s and frequencies.<br />

Wavelets are mathematical functions that divi<strong>de</strong><br />

the <strong>da</strong>ta into different frequency components, and then<br />

study each component with a resolution matched to its<br />

scale. DWT has been <strong>de</strong>veloped on this i<strong>de</strong>a. It is used<br />

more frequently in digital image watermarking due to<br />

its time/frequency <strong>de</strong>composition characteristics, which<br />

resemble to the theoretical mo<strong>de</strong>ls of the human visual<br />

system [36]. A brief <strong>de</strong>scription of the three is as follows:<br />

where matrix U is a k × k orthogonal matrix.<br />

U = [u 1 , u 2 , . . . , u r , u r + 1, u r + 2, . . . , u k ] (2)<br />

Column vectors u i , for i=1,2,. . . ,k form an orthonormal<br />

set:<br />

{<br />

u T 1 if i = j,<br />

i u j = δ ij =<br />

(3)<br />

0 if i ≠ j.<br />

and matrix V is a m × m orthogonal matrix.<br />

V = [v 1 , v 2 , . . . , v r , v r + 1, v r + 2, . . . , v k ] (4)<br />

Column vectors v i , for i=1,2,. . . ,m form an orthonormal<br />

set:<br />

{<br />

vi T 1 if i = j,<br />

v j = δ ij =<br />

(5)<br />

0 if i ≠ j.<br />

Here, S is a k × m diagonal matrix with singular<br />

values (SV) on the diagonal. The v i ’s and u i ’s are called<br />

right and left singular-vectors of X respectively.<br />

1.1.2 Discrete Cosine Transform<br />

The Discrete Cosine Transform is a technique for converting<br />

a signal into elementary frequency components<br />

[1, 31]. The DCT is applied on an image I, having<br />

K×M pixels to transform the image according to equation<br />

6 [1]:<br />

y(u, v) =<br />

√ √<br />

M−1<br />

2 2<br />

M K α ∑<br />

uα v<br />

cos<br />

(2m + 1)uΠ<br />

2M<br />

K−1<br />

∑<br />

m=0 k=0<br />

cos<br />

I(m, k)<br />

(2k + 1)vΠ<br />

2K<br />

(6)<br />

where y(u, v) is the DCT coefficients in row u and<br />

column v of the image matrix and I(m, k) is the intensity<br />

of the pixel in row m and column k of the image.<br />

The values of α u and α v are both set to 1/ √ 2 when<br />

u, v = 0 , otherwise 1. The image can be reconstructed<br />

by applying IDCT according to equation 7 [1]:<br />

1.1.1 Singular Value Decomposition<br />

Singular Value Decomposition (SVD) is an important<br />

topic in linear algebra. SVD has many practical and<br />

theoretical values; special feature of SVD is that it can<br />

be performed on any real (k, m) matrix. Suppose, we<br />

have a matrix X with k rows and m columns, with rank<br />

r and r ≤ k ≤ m. X can be factorized into three<br />

matrices [5]:<br />

X = USV T (1)<br />

I(m, k) =<br />

√<br />

2<br />

M<br />

cos<br />

√<br />

M−1<br />

2 ∑<br />

K<br />

u=0<br />

K−1<br />

∑<br />

v=0<br />

(2m + 1)uΠ<br />

2M<br />

α u α v y(u, v)<br />

cos<br />

(2k + 1)vΠ<br />

2K<br />

(7)<br />

DCT-based watermarking is based on two main concepts.<br />

The first is that low-frequency sub-band contains<br />

most of signal energy. This band contains the most important<br />

visual parts of the image. The second concept is<br />

that high frequency components of the image are usually<br />

removed through compression and noise attacks.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 27<br />

Therefore the watermark is embed<strong>de</strong>d by modifying the<br />

coefficients of the middle frequency sub-band so that<br />

the visibility of the image will not be affected and the<br />

watermark will not be removed by compression [1].<br />

1.1.3 Discrete Wavelet Transform<br />

Wavelets are special functions which are used as basal<br />

functions for representing signals. DWT is applied on<br />

two dimensional images to processing the image by 2-<br />

D filters in each dimension [1]. The filters divi<strong>de</strong> the<br />

image into four sub-bands CA, CH, CV and CD. The<br />

CA sub-band represents the approximation coefficients<br />

of DWT. The sub-bands CH, CV and CD represent the<br />

horizontal, vertical and diagonal coefficients. To obtain<br />

the next scale of wavelet coefficients, the sub-band CA<br />

is further processed until some final scale N is reached<br />

[9, 14, 27].<br />

2 Five Approaches to Digital Image Watermarking<br />

This section <strong>de</strong>scribes the above mentioned five approaches<br />

along with their strengths and weaknesses.<br />

2.1 Liu et al. : A SVD Based Watermarking Scheme<br />

Liu and Tan [25] observed that the focus of most of the<br />

watermarking schemes as proposed by researchers was<br />

to make the watermark imperceptible. The issue related<br />

to rightful ownership resolution was not well addressed.<br />

Although they found some papers [10, 13, 30, 37] in<br />

which the attention was paid to find out the solution for<br />

this problem but these were quite a few in number and<br />

had certain drawbacks. Hence a new digital watermarking<br />

scheme was proposed by them (Liu and Tan) that<br />

was based on Singular Value Decomposition and performed<br />

well both in resolving rightful ownership and in<br />

resisting common attacks. The strength of this method<br />

was that the scheme was non-invertible and gui<strong>de</strong>d us<br />

in selection of watermark and in <strong>de</strong>termination of its<br />

location. It also helped in computing the amount of watermarking<br />

energy that needs to be inserted. Such information<br />

was missing in other existing watermarking<br />

algorithms. Further it did not require encryption to resolve<br />

rightful ownership. But it had some weaknesses<br />

also. The watermark was ad<strong>de</strong>d to the singular values<br />

of the whole image. A single watermark was used in<br />

this scheme which might be lost due to attacks. This<br />

method was found to be resistant to some of the attacks<br />

like compression, filtering, cropping etc. but was not<br />

robust against the attacks including rotation and translation.<br />

2.2 Ghazy et al. : A Block-By-Block SVD Based<br />

Watermarking Scheme<br />

The authors [16] presented a block based digital image<br />

watermarking scheme using SVD. In this approach,<br />

the original image was divi<strong>de</strong>d into blocks and embedding<br />

of watermark was done in the singular values of<br />

each block separately. In the non blocked watermarking<br />

scheme there was a risk of losing the watermark<br />

due to attacks. This was attributed to the fact that the<br />

watermark was ad<strong>de</strong>d to the singular values (SVs) of<br />

the whole image. To cope up this drawback, the original<br />

image was first segmented into blocks and watermark<br />

was ad<strong>de</strong>d to the SVs of each block. As a result<br />

of several watermarked blocks, we could recover several<br />

watermarks. We would still be left with some of<br />

the watermarks even if many were lost due to attacks.<br />

This method was robust against many attacks such as<br />

JPEG compression, cropping, blurring, Gaussian noise,<br />

resizing and rotation [15]. A watermark can be either a<br />

pseudo-random number or an image. This method has<br />

one disadvantage also. It is not resistant to translation<br />

operation.<br />

2.3 Ganic and Eskicioglu : DWT-SVD Based Watermarking<br />

Scheme<br />

In their paper, Ganic and Eskicioglu [17] presented a<br />

hybrid scheme based on DWT and SVD in which the<br />

cover image was first divi<strong>de</strong>d into four bands and thereafter<br />

SVD was applied to each band and then singular<br />

values were modified to embed the same watermark.<br />

The scheme proved to be robust to wi<strong>de</strong> range of attacks.<br />

In two dimensional DWT, the four bands LL,<br />

HL, LH and HH are produced at each level of <strong>de</strong>composition.<br />

Prior to this paper, Mehul and Priti [32] used<br />

two level <strong>de</strong>composition and the two second level subbands<br />

LL and HH were used to embed two different<br />

watermarks. The results <strong>de</strong>picted robustness against<br />

JPEG compression, wiener filtering, Gaussian noise,<br />

scaling and cropping upon embedding the watermark<br />

in LL band while embedding in HH band resulted in<br />

robustness against histogram equalization, intensity adjustment<br />

and gamma correction. But the visibility of<br />

the embed<strong>de</strong>d watermark was noticed all over the cover<br />

image thus reducing the value of the image. Ganic and<br />

Eskicioglu generalized the scheme to the four subbands<br />

using DWT-SVD watermarking. Instead of using different<br />

values of scaling factor for the four subbands<br />

only two were used; one value was assigned to LL subband<br />

contributing the largest singular value while another<br />

smaller value for all other three subbands. These<br />

subbands usually have <strong>de</strong>creasing singular values as we<br />

move from HL to HH bands but exceptions are there.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 28<br />

Using this hybrid scheme it was observed that no difficulty<br />

was experienced in modifying the LL band which<br />

was otherwise problematic in most DWT based watermarking<br />

techniques. Further it was also <strong>de</strong>monstrated<br />

that watermarks inserted in the LL subband are resistant<br />

to one group of attacks such as gussian blur, noise,<br />

pixilation, JPEG compression, and rescaling while inserted<br />

in the HH subband are resistant to another group<br />

of attacks such as sharpening, cropping, contrast adjustment,<br />

histogram equalization, and gamma correction<br />

[35]. An advantage of SVD was the embedding<br />

of only the smaller set (more significant) of singular<br />

values of the visual watermark. This scheme had certain<br />

limitations also. After the cropping attack, singular<br />

value extraction in the HL subband did not allow proper<br />

construction of the watermark although the correlation<br />

coefficient was high. Moreover there is no general formula<br />

for <strong>de</strong>termining the values of scaling factor for<br />

each subband.<br />

2.4 S. M. Rafizul Haque : SVD-DCT Based Watermarking<br />

Scheme<br />

Rafizul [21], in his thesis, presented a modified DCT-<br />

SVD based watermarking scheme to provi<strong>de</strong> robustness<br />

mainly against rotation (R), scaling (S) and translation<br />

(T) attacks. He ad<strong>de</strong>d an extra step called the preprocessing<br />

step before the watermark extraction which actually<br />

resulted in watermarked image that was capable<br />

to resist large angle rotation, scaling and translation attacks<br />

thus making the scheme more robust. Though this<br />

scheme is RST invariant, but the value of correlation<br />

coefficient is not very good. Moreover for most of the<br />

attacks, extracted watermarks from four quadrants are<br />

not of the same quality.<br />

2.5 Majum<strong>de</strong>r et al. : A Hybrid SVD and Wavelet<br />

Based Watermarking<br />

Majum<strong>de</strong>r et al. [26] proposed hybrid SVD and wavelet<br />

based watermarking scheme that is different from the<br />

one discussed above (section 2.3). In this scheme, the<br />

cover image was first divi<strong>de</strong>d into four subbands (LL,<br />

HL, LH and HH) and SVD was applied on each subbands<br />

to obtain U LL , S LL and V LL from LL band and<br />

so on from HL, LH and HH as well. Then watermark<br />

was iterated and was multiplied by a number named as<br />

KEY and was ad<strong>de</strong>d with the singular values(S LL )<br />

to yield new matrixSLL ⋆ that was no longer a simple<br />

diagonal matrix. This is because of the fact that addition<br />

gives some extra non-zero values at positions<br />

other than the diagonal. The KEY may have any value<br />

greater than 0 but less than 1. This was done to reduce<br />

the impact of watermark. The SVD was again<br />

applied to the new matrixSLL ⋆ yield U1 LL, S1 LL and<br />

V 1 LL . Watermarked LL subband was computed using<br />

the equation LL w = U LL S1 LL VLL T . Similarly<br />

HL w ,LH w andHH w were computed. Another equation<br />

LL k = U1 LL S LL V 1 T LL was used to obtain key<br />

subband of LL called LL k and similarly HL k , LH k<br />

and HH k . The watermarked image was then transmitted.<br />

It might be corrupted due to noise or other attacks<br />

before it reaches the <strong>de</strong>stination. In or<strong>de</strong>r to extract<br />

the watermark, the key image and the value of KEY<br />

is required along with corrupted watermarked image.<br />

DWT was applied on the corrupted watermarked image<br />

and key image so as to obtain LL w ,HL w , LH w<br />

and HH w andLL k , HL k , LH k and HH k respectively.<br />

SVD was applied on LL k to obtainU k ,S k and<br />

V k and on LL w to obtain U w ,S w and V w . Matrix<br />

D = U k S w V k was computed and extracted average coefficients<br />

of watermark LL mark were obtained by computing<br />

LL mark = 1<br />

KEY × S k. Similarly HL mark ,<br />

LH mark and HH mark were calculated and IDWT was<br />

applied to extract the watermark. The results showed<br />

the robustness of the scheme against the application of<br />

different attacks and they were able to extract visibly<br />

good watermark.<br />

3 Improved Watermarking Scheme<br />

Generally, SVD transform can be applied to an image<br />

with two different techniques: on the whole image and<br />

on blocks of the image [4]. The former tends to spread<br />

the watermark all over the image, whereas the latter<br />

only affects local regions of the image.<br />

The improvement in watermarking scheme, we intend<br />

to propose is block-based. The basic i<strong>de</strong>a of the improved<br />

algorithm is to <strong>de</strong>compose the cover image to<br />

approximation coefficients (CA), horizontal <strong>de</strong>tail coefficients<br />

(CH), vertical <strong>de</strong>tail coefficients (CV) and diagonal<br />

<strong>de</strong>tail coefficients (CD) which we get after applying<br />

DWT transform on cover image. These bands are<br />

first divi<strong>de</strong>d into non-overlapping blocks. Thereafter<br />

SVD transform is applied on these non-overlapping<br />

blocks CA i ,CH i ,CV i ,CD i to compute Ua i ,Sa i ,<br />

V a i from CA i and so on from CH i ,CV i ,CD i as well.<br />

We embed the singular values of watermark in the singular<br />

values of these non-overlapping blocks. The steps<br />

are as follows:<br />

3.1 Improved Watermark Embedding Scheme<br />

The steps for improved watermarking embedding are as<br />

follows:<br />

1. Use DWT to <strong>de</strong>compose the cover image (F matrix)<br />

into four separate <strong>da</strong>ta sets: CA, CH, CV, and<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 29<br />

CD.<br />

2. Divi<strong>de</strong> CA, CH, CV, and CD <strong>da</strong>tasets as obtained<br />

from step 1 into non overlapping blocks.<br />

3. Perform SVD on each block to obtain the SVs of<br />

each block.<br />

CH i = Uh i Sh i V h T i (8)<br />

CD i = Ud i Sd i V d T i (9)<br />

CA i = Ua i Sa i V a T i (10)<br />

CV i = Uv i Sv i V v T i (11)<br />

where i=1,2,. . . ,N. N is the number of blocks.<br />

4. Apply SVD to the watermark W .<br />

W = U w S w V T w (12)<br />

S w contains the singular values λ wi ,<br />

where i=1,2,. . . ,n.<br />

5. Modify the singular values of the subbands of the<br />

cover image with the singular values of the visual<br />

watermark:<br />

λ ⋆ i = λ i + αλ wi (13)<br />

whereλ i , i=1,2,. . . ,n. are the singular values of<br />

Sd i ,Sh i ,Sv i and Sa i . α is the scaling factor.<br />

6. Find the four set of modified DWT coefficients:<br />

3. Perform SVD on each block to obtain the SVs of<br />

each block.<br />

CH i = Uh i Sh i V h T i (18)<br />

CD i = Ud i Sd i V d T i (19)<br />

CA i = Ua i Sa i V a T i (20)<br />

CV i = Uv i Sv i V v T i (21)<br />

4. Extract the singular values from each block:<br />

λ wi = (λ ⋆ i − λ i )/α (22)<br />

5. Use the S matrix of each block to build the watermarked<br />

blocks in the spatial domain.<br />

W i = U w S wi V T w (23)<br />

4 Experimentation and Results<br />

4.1 Experiment 1 and Results<br />

In or<strong>de</strong>r to verify the validity of improved watermarking<br />

scheme, we choose two different watermark images<br />

each of size 256 × 256 . Four different cover images<br />

each of size 256 × 256 have been used. The scaling<br />

factor has been chosen to be equal to 0.5. The ’Haar’<br />

wavelet has been used [19]. Figure 1 shows the cover<br />

images Fig 1 (a, b, c d), watermark images Fig1 (e, f).<br />

CH i = Uh i Sh ⋆ i V h T i (14)<br />

CD i = Ud i Sd ⋆ i V d T i (15)<br />

CA i = Ua i Sa ⋆ i V a T i (16)<br />

CV i = Uv i Sv ⋆ i V v T i (17)<br />

7. Rearrange the DWT coefficients back into one matrix<br />

to build the CA, CH, CV and CD <strong>da</strong>tasets.<br />

8. Apply the inverse DWT to produce the watermarked<br />

cover image.<br />

Figure 1: Cover images: (a) Lena (b) Barbara (c) Baboon (d) Peppers;<br />

Watermark images (e) Logo (f) Bird<br />

3.2 Improved Watermark Extraction Scheme<br />

The steps of watermarking extraction are as follows:<br />

1. Apply the DWT to the whole watermarked cover<br />

image (and possibly attacked) image F ∗ into four<br />

<strong>da</strong>tasets: CA, CH, CV, and CD.<br />

2. Divi<strong>de</strong> CA, CH, CV and CD <strong>da</strong>tasets into non<br />

overlapping blocks having the same size used in<br />

embedding process.<br />

4.2 Experiment 2 and Results<br />

In this section, we perform the implementations of<br />

schemes as proposed by Liu [25], Ghazy [15, 16],<br />

Rafizul Haque [21], Emir Ganic [17], Majum<strong>de</strong>r [26],<br />

and the improved approach. The above said six methods<br />

have been tested against ten different attacks. The<br />

attacks chosen are Gaussian Noise, rotation, cropping,<br />

Gaussian blur, median filtering, histogram equalization,<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 30<br />

sharping, transform, rescaling and Gamma Correction.<br />

The first attack applied is Gaussian Noise with zero<br />

mean and 0.5 variance. The second attack is rotation<br />

by 30 <strong>de</strong>gree and 75 <strong>de</strong>gree. The next image manipulation<br />

is cropping. We use a part of the image by selecting<br />

50 % of the original size at the center and cropping every<br />

other pixel. The fourth attack is blurring using low<br />

pass filter of 3 × 3 window size. The fifth attack is median<br />

filtering. The sixth attack is histogram equalization.<br />

The seventh attack is image sharping. Next attack<br />

we applied on the watermark image is transform. The<br />

ninth attack is rescaling, the watermarked image was<br />

scaled from 256 × 256 to 128 × 128, and then rescaled<br />

to its original size. Lastly, we perform gamma correction<br />

attack that changes the brightness of pixels of the<br />

watermarked image by a specified factor 1.5.<br />

Correlation metric has been used for comparison between<br />

original watermark and extracted watermark after<br />

applying attacks on watermarked image. Figure<br />

2 <strong>de</strong>picts the attacked images.The watermarks extracted<br />

from Peppers and Barbara images using proposed<br />

scheme are as shown in Figures 3 and 4 respectively.<br />

Figure 3: Extracted watermarks from Peppers as cover image and<br />

Logo as a watermark image using Proposed Method; (a) Gaussian<br />

Noise (b) Rotate 30 (c) Cropping (Left Half) (d) Median Filtering (e)<br />

Histogram (f) Sharpning (g) Resize (h) Gamma Correction (i) Transform<br />

Figure 2: Attacked images; (a) Gaussian Noise (b) Rotate 30 (c)<br />

Cropping (Left Half) (d) Median Filtering (e) Histogram (f) Sharpning<br />

(g) Resize (h) Gamma Correction (i) Transform<br />

Correlation coefficients corresponding to images<br />

i.e., Barbara and Lena as cover images and logo as a<br />

watermark image are given in Tables 1 and 2 respectively.<br />

Tables 3 and 4 show the correlation coefficients<br />

corresponding to images i.e., Peppers and Baboon as<br />

cover images and bird as a watermark image respectively.Prop<br />

stands for proposed method in all the tables.<br />

Figure 4: Extracted watermarks from Barbara as cover image and<br />

Bird as a watermark image using Proposed Method; (a) Gaussian<br />

Noise (b) Rotate 30 (c) Cropping (Left Half) (d) Median Filtering (e)<br />

Histogram (f) Sharpning (g) Resize (h) Gamma Correction (i) Transform<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 31<br />

Table 1: Correlation coefficients for Barbara image as cover image<br />

and logo image as watermark<br />

Table 4: Correlation coefficients for Baboon image as cover image<br />

and Bird image as watermark<br />

Attacks Liu Gha Emir Haq Mis P rop<br />

G.Noise 0.61 0.68 0.57 0.58 0.72 0.76<br />

G.Blur 0.86 0.92 0.96 0.96 0.94 0.96<br />

Crop(R.H) 0.60 0.97 0.95 0.91 0.94 0.99<br />

Crop(L.H) 0.49 0.97 0.88 0.95 0.88 0.98<br />

Rotate30 0.64 0.79 0.54 0.62 0.87 0.93<br />

Rotate75 0.75 0.80 0.52 0.70 0.87 0.91<br />

Mid.F il. 0.94 0.94 0.97 0.98 0.95 0.97<br />

Hist.Eq. 0.88 0.90 0.99 0.99 0.99 0.99<br />

Sharp 0.75 0.82 0.89 0.89 0.88 0.96<br />

T rans 0.87 0.90 0.60 0.71 0.86 0.97<br />

Resize 0.99 0.99 0.85 0.92 0.92 0.89<br />

G.Corr 0.96 0.98 0.99 0.99 0.99 0.99<br />

Attacks Liu Gha Emir Haq Mis P rop<br />

G.Noise 0.57 0.65 0.58 0.57 0.65 0.69<br />

G.Blur 0.73 0.80 0.83 0.80 0.85 0.86<br />

Crop(R.H) 0.38 0.98 0.72 0.81 0.80 0.99<br />

Crop(L.H) 0.33 0.98 0.66 0.74 0.77 0.99<br />

Rotate30 0.40 0.49 0.54 0.52 0.62 0.69<br />

Rotate75 0.50 0.70 0.58 0.58 0.61 0.71<br />

Mid.F il. 0.74 0.78 0.89 0.88 0.86 0.89<br />

Hist.Eq. 0.99 0.98 0.98 0.97 0.98 0.98<br />

Sharp 0.45 0.64 0.81 0.80 0.75 0.85<br />

T rans 0.66 0.78 0.60 0.61 0.66 0.87<br />

Resize 0.89 0.93 0.75 0.79 0.65 0.79<br />

G.Corr 0.75 0.76 0.98 0.98 0.96 0.99<br />

Table 2: Correlation coefficients for Lena image as cover image and<br />

logo image as watermark<br />

Attacks Liu Gha Emir Haq Mis P rop<br />

G.Noise 0.40 0.51 0.55 0.44 0.52 0.59<br />

G.Blur 0.97 0.97 0.98 0.96 0.97 0.99<br />

Crop(R.H) 0.43 0.97 0.97 0.99 0.98 0.99<br />

Crop(L.H) 0.67 0.98 0.97 0.96 0.96 0.99<br />

Rotate30 0.62 0.75 0.61 0.63 0.82 0.83<br />

Rotate75 0.74 0.83 0.59 0.66 0.81 0.87<br />

Mid.F il. 0.98 0.99 0.99 0.98 0.98 0.99<br />

Hist.Eq. 0.96 0.98 0.99 0.98 0.99 0.99<br />

Sharp 0.86 0.91 0.95 0.92 0.96 0.97<br />

T rans 0.86 0.89 0.71 0.75 0.83 0.92<br />

Resize 0.99 0.99 0.89 0.96 0.94 0.92<br />

G.Corr 0.96 0.96 0.99 0.97 0.99 0.99<br />

Table 3: Correlation coefficients for Peppers image as cover image<br />

and Bird image as watermark<br />

Attacks Liu Gha Emir Haq Mis P rop<br />

G.Noise 0.53 0.60 0.53 0.53 0.58 0.63<br />

G.Blur 0.91 0.93 0.95 0.86 0.92 0.96<br />

Crop(R.H) 0.33 0.98 0.87 0.95 0.92 0.99<br />

Crop(L.H) 0.36 0.95 0.89 0.92 0.93 0.97<br />

Rotate30 0.41 0.48 0.51 0.53 0.58 0.66<br />

Rotate75 0.56 0.61 0.51 0.57 0.56 0.75<br />

Mid.F il. 0.95 0.95 0.97 0.97 0.95 0.98<br />

Hist.Eq. 0.89 0.95 0.99 0.96 0.96 0.98<br />

Sharp 0.69 0.82 0.90 0.84 0.88 0.91<br />

T rans 0.68 0.71 0.55 0.66 0.62 0.90<br />

Resize 0.96 0.98 0.84 0.86 0.85 0.86<br />

G.Corr 0.78 0.78 0.99 0.98 0.99 0.99<br />

These tables show the correlation coefficients between<br />

the original watermark and extracted watermark<br />

using Liu, Ghazy, Emir Ganic, Rafizul Haque, Majum<strong>de</strong>r,<br />

and proposed method. Maximum value of correlation<br />

coefficients means more similarity between ex-<br />

tracted watermark and original watermark. The correlation<br />

coefficients using proposed method for Gaussian<br />

noise, Gaussian blurring, cropping, sharping, transform<br />

and rotation are far better and for other attacks such as<br />

histogram equalization, gamma correction attacks, and<br />

there is slight improvement.<br />

The results reveal that proposed method outperforms<br />

the other ones for cropping, rotations, sharping, transform,<br />

blurring and noise attacks. For Gamma correction<br />

and histogram equalization attacks, the results obtained<br />

using other methods are more or less equal to<br />

those as obtained using proposed method. In case of<br />

median filtering attack and gamma correction, Rafizul<br />

Haque and Majum<strong>de</strong>r method performs better for one<br />

image (Barbara) respectively whereas for other images<br />

the proposed method gives good results though the difference<br />

is very little. In case of rescaling (or resizing)<br />

attack, Gahzy method gives better result as compared to<br />

other methods. For Peppers, Lena as cover images and<br />

bird as watermark image, Emir Ganic method performs<br />

better un<strong>de</strong>r histogram equalization attack.<br />

Next, we saw the effect of adding salt and peeper noise<br />

to watermarked images with <strong>de</strong>nsities within the interval<br />

[0.001, 0.09]. Tables 5 and 6 give correlation coefficients<br />

after applying salt and peeper noise attack for<br />

Barbara as cover images and logo and bird as watermark<br />

images. The results show that proposed method<br />

gives better results as the value of <strong>de</strong>nsity increases.<br />

Another experiment was performed to see the effect<br />

of adding Gaussian noise to the watermarked image<br />

with different variance values using Barbara as cover<br />

images and bird and logo as watermark images and the<br />

results are tabulated in Tables 7 and 8. The results reveal<br />

that proposed method gives better results as the<br />

value of variance increases. But at low variance, other<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 32<br />

Table 5: Correlation coefficients for Salt and pepper noise attacks Table 8: Correlation coefficients for Gaussian noise attacks with different<br />

noise variances using Barbara as cover and bird as watermark<br />

with different noise <strong>de</strong>nsities using Barbara as cover and logo as watermark<br />

Den. Liu Gha Emir Haq Mis P rop<br />

0.001 0.999 0.999 0.999 0.999 0.999 0.999<br />

0.003 0.998 0.999 0.999 0.998 0.998 0.999<br />

0.005 0.997 0.999 0.998 0.997 0.998 0.999<br />

0.007 0.996 0.997 0.997 0.996 0.997 0.998<br />

0.009 0.992 0.996 0.995 0.995 0.996 0.997<br />

0.01 0.990 0.994 0.995 0.993 0.995 0.996<br />

0.03 0.953 0.961 0.966 0.966 0.978 0.979<br />

0.05 0.912 0.921 0.926 0.919 0.944 0.955<br />

0.07 0.862 0.895 0.883 0.858 0.905 0.924<br />

0.09 0.824 0.8554 0.8274 0.815 0.8764 0.898<br />

V ar. Liu Gha Emir Haq Mis P rop<br />

0.001 0.962 0.984 0.992 0.932 0.991 0.989<br />

0.005 0.931 0.961 0.974 0.827 0.977 0.944<br />

0.01 0.882 0.923 0.935 0.742 0.951 0.887<br />

0.05 0.637 0.713 0.631 0.535 0.748 0.685<br />

0.1 0.527 0.607 0.511 0.498 0.615 0.641<br />

0.2 0.450 0.528 0.479 0.472 0.509 0.587<br />

0.3 0.416 0.500 0.466 0.463 0.448 0.579<br />

0.4 0.395 0.478 0.463 0.452 0.433 0.568<br />

0.5 0.382 0.468 0.455 0.450 0.425 0.568<br />

0.6 0.373 0.464 0.455 0.434 0.428 0.560<br />

Table 6: Correlation coefficients for Salt and pepper noise attacks<br />

with different noise <strong>de</strong>nsities using Barbara as cover and bird as watermark<br />

Den. Liu Gha Emir Haq Mis P rop<br />

0.001 0.999 0.999 0.998 0.998 0.998 0.999<br />

0.003 0.998 0.997 0.998 0.998 0.997 0.998<br />

0.005 0.995 0.997 0.998 0.998 0.995 0.998<br />

0.007 0.991 0.995 0.995 0.995 0.993 0.997<br />

0.009 0.988 0.991 0.994 0.994 0.987 0.995<br />

0.01 0.985 0.989 0.992 0.993 0.986 0.994<br />

0.03 0.939 0.943 0.959 0.967 0.934 0.966<br />

0.05 0.883 0.892 0.910 0.917 0.873 0.955<br />

0.07 0.834 0.848 0.847 0.866 0.829 0.924<br />

0.09 0.796 0.818 0.768 0.819 0.781 0.898<br />

methods have an edge over the proposed one.<br />

Table 7: Correlation coefficients for Gaussian noise attacks with different<br />

noise variances using Barbara as cover and logo as watermark<br />

The result shows that proposed method gives better correlation<br />

un<strong>de</strong>r different wavelets.<br />

Figure 5 shows the effect of scaling factor on the wa-<br />

Table 9: Correlation coefficients for different wavelet un<strong>de</strong>r sharpening<br />

attack<br />

W avelet Emir Mis P rop<br />

Haar 0.824 0.772 0.874<br />

Daubechies(db2) 0.787 0.208 0.836<br />

Symlet(sym2) 0.787 0.208 0.868<br />

Biorthogonal(bior2.2) 0.823 0.265 0.871<br />

Coifman(coif2) 0.775 0.395 0.869<br />

termarked image for proposed method.Peak Signal to<br />

Noise Ratio (PSNR) for different scaling factors on watermarked<br />

image is tabulated in Tables 10 and 11 for<br />

one cover images and two watermark images.<br />

V ar. Liu Gha Emir Haq Mis P rop<br />

0.001 0.998 0.998 0.999 0.998 0.999 0.998<br />

0.005 0.981 0.9841 0.989 0.987 0.992 0.990<br />

0.01 0.951 0.960 0.968 0.963 0.976 0.977<br />

0.05 0.747 0.795 0.759 0.736 0.844 0.813<br />

0.1 0.616 0.684 0.573 0.579 0.727 0.758<br />

0.2 0.510 0.593 0.476 0.431 0.633 0.644<br />

0.3 0.464 0.557 0.438 0.415 0.569 0.597<br />

0.4 0.443 0.532 0.425 0.410 0.549 0.593<br />

0.5 0.422 0.512 0.422 0.408 0.534 0.589<br />

0.6 0.419 0.507 0.418 0.402 0.519 0.585<br />

Lastly,we perform the experiments to show the effect<br />

of scaling factor and wavelet on proposed method.<br />

Table 9 gives correlation coefficients for different<br />

wavelets applying on proposed, Emric Ganic and Majum<strong>de</strong>r<br />

methods un<strong>de</strong>r image sharping attack using<br />

barabara as cover image and bird as a watermark image.<br />

Figure 5: Effect of scaling factor on watermarked image using Lena<br />

as cover image and bird as watermark image<br />

The results reveal that the increase in the value of<br />

scaling factor results in <strong>de</strong>crease in PSNR. It means that<br />

distortion in watermarked image increases when the<br />

scaling factor increases. The results also <strong>de</strong>monstrate<br />

that Liu and Ghazy methods give best quality image.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 33<br />

Table 10: PSNR un<strong>de</strong>r different scaling factor using Lena as cover<br />

and logo as watermark<br />

Scal. Liu Gha Emir Haq Mis P rop<br />

0.1 44.92 42.67 31.36 31.39 38.73 31.48<br />

0.2 36.25 34.83 25.53 25.61 29.93 25.79<br />

0.3 31.64 29.80 22.32 22.42 25.72 22.68<br />

0.4 28.12 26.51 20.16 20.27 23.12 20.57<br />

0.5 25.40 23.84 18.57 18.67 21.28 19.01<br />

0.6 22.76 21.83 17.32 17.42 19.87 17.78<br />

0.7 20.94 20.33 16.31 16.43 18.73 16.79<br />

0.8 19.59 19.04 15.47 15.59 17.82 15.95<br />

0.9 18.54 17.95 14.76 14.89 17.05 15.24<br />

1.0 17.64 17.04 14.14 14.28 16.36 14.63<br />

In this paper, an improvement in the existing scheme<br />

was suggested whereby we divi<strong>de</strong>d the <strong>da</strong>ta sets (bands)<br />

into non-overlapping blocks and then modified singular<br />

values of each block with the singular values of watermark<br />

image. A correlation metric has been used for performance<br />

comparison between proposed method and<br />

the other methods. Proposed method gives much better<br />

results in terms of correlation coefficients against Gaussian<br />

noise, rotation, cropping, sharping, and transform<br />

attacks. The proposed technique and Ganic method give<br />

almost comparable results for median filtering, gamma<br />

correction, Gaussian bluring, rescaling and histogram<br />

equalization. The proposed method also performs better<br />

against Gaussian noise and Salt and Peeper Noise<br />

particularly when the noise variance and <strong>de</strong>nsity values<br />

are high. The proposed method is best even for four different<br />

wavelets used. The quality of watermarked image<br />

for proposed method, though not best, still it is better<br />

or atleast comparable with some of the techniques.<br />

The experimental results confirm that proposed method<br />

outperforms the other methods against some of the image<br />

processing attacks whereas it is at par with the other<br />

methods for the rest of the attacks.<br />

References<br />

[1] Al-Hai, A. Combined dwt-dct digital image watermarking.<br />

Computer Science, 3(9):740–746,<br />

2007.<br />

Table 11: PSNR un<strong>de</strong>r different scaling factor using Lena as cover<br />

and Bird as watermark<br />

Scal. Liu Gha Emir Haq Mis P rop<br />

0.1 37.36 35.53 25.85 25.98 28.38 26.24<br />

0.2 27.94 26.16 20.42 20.58 22.53 20.80<br />

0.3 21.92 21.49 17.50 17.67 19.61 17.97<br />

0.4 18.87 18.63 15.54 15.72 17.61 16.01<br />

0.5 16.85 16.73 14.12 14.30 16.09 14.58<br />

0.6 15.47 15.40 13.04 13.22 14.95 13.46<br />

0.7 14.51 14.45 12.17 12.33 14.03 12.56<br />

0.8 13.81 13.75 11.45 11.61 13.28 11.83<br />

0.9 13.27 13.20 10.84 10.99 12.66 11.22<br />

1.0 12.85 12.73 10.33 10.46 12.13 10.68<br />

The proposed method, though not so good so far as<br />

PSNR and hence the image quality is concerned, still it<br />

is better or at least comparable with Rafizul and Emir<br />

Ganic methods.<br />

5 Conclusions<br />

[2] Arya, D. A survey of frequency and wavelet domain<br />

digital watermarking techniques. Scientific<br />

and Engineering Research, 1(2):1–4, 2010.<br />

[3] Bao, P. and Ha, X. Image a<strong>da</strong>ptive watermarking<br />

using wavelet domain singular value <strong>de</strong>compostion.<br />

IEEE Trans. on Circuits and Systems for<br />

Vi<strong>de</strong>o Technology, 15(1):96–102, 2005.<br />

[4] Basso, A., Berga<strong>da</strong>no, F., Cavagnino, D., Pomponiu,<br />

V., and Vernone, A. A novel block-based<br />

watermarking scheme using the svd transform. Algorithm,<br />

2(1):46–75, 2009.<br />

[5] Cao, L. Singular value <strong>de</strong>composition applied to<br />

digital image processing. Master’s thesis, Arizona<br />

State University Polytechnic Campus, Arizona,<br />

2007.<br />

[6] Chandra, D. V. S. Digital image watermarking using<br />

singular value <strong>de</strong>composition. In Proceeding<br />

of IEEE Midwest Symposium on Circuits and Systems,<br />

pages 264–267, Tulsa, USA, 2002.<br />

[7] Chang, C. C., Lin, C. C., and Tsai, P. Svd<br />

based digital image watermarking scheme. Pattern<br />

Recognition Letters, pages 1577–1586, 2005.<br />

[8] Chung, K., Shen, C., and Chang, L. A novel<br />

svd and vq-based image hiding scheme. Pattern<br />

Recognition Letters, 22(9):1051–1058, 2001.<br />

[9] Chung, Y. and Kim, C. Robust image watermarking<br />

against filtering attacks. In SICE Annual Conference,<br />

pages 3017–3020, Fukui, Japan, 2003.<br />

[10] Cox, I., Kilian, J., Leighton, F., and Shamoon,<br />

T. Secure spread spectrum watermarking for<br />

multimedia. IEEE Trans. on Image Processing,<br />

6(12):1673–1687, 1997.<br />

[11] Cox, I., Millar, M., and Bllom, J. Watermarking<br />

applications and their properties. In International<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 34<br />

Conference on Information Technology, pages 6–<br />

10, 2000.<br />

[12] Cox, I., Millar, M., and Bllom, J. Digital Watermarking.<br />

Morgan-Kaufmann, San Francisco, CA,<br />

2002.<br />

[23] Lee, S., Jang, D., and Yoo, C. D. An svd-based<br />

watermarking method for image content authentication<br />

with improved security. In Proceedings<br />

of IEEE International Conference on Acoustics,<br />

Speech, and Signal Processing, pages 525–528,<br />

2005.<br />

[13] Craver, S., Memon, N., Yeo, B., and Yeung, M.<br />

Can invisible watermarks resolve rightful ownership.<br />

Technical Report RC-20509, IBM Research<br />

Division, July 1996.<br />

[14] Furht, B. and Kirovski, D. Multimedia Watermarking<br />

Techniques and Applications. Auerbach<br />

Publication, 2006.<br />

[15] Gahzy, R., El-Fishawy, N., Hadhoud, M., and El-<br />

Samie, F. A. An efficient block-by-block svd<br />

based image watermarking scheme. Ubiquitous<br />

Computing and Communication, 2(5):1–9, 2007.<br />

[16] Gahzy, R., El-Fishawy, N., Hadhoud, M., and El-<br />

Samie, F. A. Performance evaluation of block<br />

based svd image watermarking. Electromagnetics<br />

Research, 8:147–159, 2008.<br />

[17] Ganic, E. and Eskicioglu, A. M. Robust dwt-svd<br />

domain image watermarking: Embedding <strong>da</strong>ta in<br />

all frequencies. In Proceedings of the 2004 workshop<br />

on Multimedia and security, pages 20–21,<br />

Mag<strong>de</strong>burg, Germany, 2004.<br />

[18] Ganic, E., Zubair, N., and Eskicioglu, A. M. An<br />

optimal watermarking scheme based on singular<br />

value <strong>de</strong>composition. In International Conference<br />

on Communication, Network and Information Security,<br />

pages 85–90, New York, USA, 2003.<br />

[19] Gonzalez, R. and Woods, R. Digital Image Processing.<br />

Prentice Hall Inc, 2002.<br />

[20] Gunjal, B. L. and Manthalkar, R. An overview<br />

of transform domain robust digital image watermarking<br />

algorithms. Emerging Trends in Computing<br />

and Information Sciences, 2(1):37–42, 2010.<br />

[21] Haque, R. Singular value <strong>de</strong>composition and<br />

discrete cosine transform based watermarking.<br />

Master’s thesis, Blekinge Institute of Technology,<br />

Swe<strong>de</strong>n, 2008.<br />

[22] Hartung, F. and Kutter, M. Multimedia watermarking<br />

techniques. IEEE, 87(7):1079–1107,<br />

1999.<br />

[24] Liu, J., Niu, X., and Kong, W. Image watermarking<br />

scheme based on singular value <strong>de</strong>composition.<br />

In International Conference on Intelligent<br />

Information Hiding and Multimedia, pages 457–<br />

460, Pasa<strong>de</strong>na, California, 2006.<br />

[25] Liu, R. and Tan, T. An svd-based watermarking<br />

scheme for protecting rightful ownership. IEEE<br />

Trans. on Multimedia, 4(1):121–128, 2002.<br />

[26] Majum<strong>de</strong>r, S., Mishra, M., and Singh, A. D. A<br />

hybrid svd and wavelet based watermarking. In<br />

National conference on Mathematical techniques:<br />

Emerging Paradigms for Electronics and IT Industries,<br />

Delhi , India, 2008.<br />

[27] Meerwald, P. Digital image watermarking in the<br />

wavelet transform domain. Master’s thesis, University<br />

of Salzburg, 2001.<br />

[28] Miller, M., Cox, I., Linnartz, J., and Kalker, T. A<br />

review of watermarking principles and practices.<br />

In IEEE International Conference on Image Processing,<br />

1997.<br />

[29] Podilchuk, C. I. and Delp, E. J. Digital watermarking:<br />

Algorithms and applications. IEEE Signal<br />

Processing Magazine, 18(4):33–46, 2001.<br />

[30] Qiao, L. and Nahrstedt, K. Watermarking schemes<br />

and protocols for protecting rightful ownership<br />

and customer’s rights. Visual Communication and<br />

Image Representation, 9(3):194–210, 1998.<br />

[31] Rao, K. and Yip, P. Discrete Cosine Transform:<br />

Algorithms, Advantages and applications. Aca<strong>de</strong>mic<br />

Press, Inc., San, Diego, 2002.<br />

[32] Raval, M. and Rege, P. Discrete wavelet transform<br />

based multiple watermarking scheme. In IEEE<br />

Conference on Convergent Technologies, Bangalore,<br />

India, 2003.<br />

[33] Rezaza<strong>de</strong>h, S. and Yazdi, M. A non-oblivious image<br />

watermarking system based on singular value<br />

<strong>de</strong>composition and texture segmentation. Applied<br />

Science Engineering and Technology, 1(3):1079–<br />

1107, 2006.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Dinesh Kumar and Vijay Chahar Digital Image Watermarking: A Review of SVD, DCT and DWT Based Approaches 35<br />

[34] Sverdlov, A., Dexter, S., and Eskicioglu, A. M.<br />

Robust dct-svd domain image watermarking for<br />

copyright protection: Embedding <strong>da</strong>ta in all frequencies.<br />

In European Signal Processing Conference,<br />

pages 4–8, Antalya, Turkey, 2005.<br />

[35] Thapa, M., Sood, S., and Sharma, A. Digital image<br />

watermarking technique based on different attacks.<br />

Advanced Computer Science and Applications,<br />

2(4):14–19, 2011.<br />

[36] Vetterli, M. and Kovacevic, J. Wavelets and Subband<br />

Coding. Prentice Hall, USA, 1995.<br />

[37] Wolfgang, R. and Delp, E. J. A watermark technique<br />

for digital imagery: further studies. In Proceedings<br />

of International Conference on Imaging<br />

science, Systems and technology, Las Vegas,<br />

Neva<strong>da</strong>, 1997.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 25-35, September of 2011.


Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu<br />

Machine Translation<br />

SHAHNAWAZ 1<br />

R. B. MISHRA 2<br />

IT-BHU, Institute of Technology, Banaras Hindu University<br />

Department of Computer Engineering<br />

Varanasi, U.P., India-221005<br />

1 shahnawaz.rs.cse@itbhu.ac.in<br />

2 ravibm@bhu.ac.in<br />

Abstract. In this paper we discuss the working of our English to Urdu Machine Translation (MT) system.<br />

We used feed-forward back-propagation artificial neural network for the selection of Urdu words/tokens<br />

(such as verb, noun/pronoun etc.) and translation rules for grammar structure equivalent to English<br />

words/tokens and grammar structure rules respectively. As English is SVO class language while Urdu<br />

is SOV class language so grammar structure transfer is main task in English-Urdu machine translation<br />

problem. Our system is able to translate sentences having gerund, having infinitives (maximum two),<br />

having prepositions and prepositional objects (maximum three), direct object, indirect object etc. Neural<br />

network works as the knowledge base for linguistic rules and bilingual dictionary. Bilingual dictionary<br />

not only stores the meaning of English word in Urdu but also stores linguistic features attached to the<br />

word. The output of our system is presented in Romanized Urdu. The n-gram blue score achieved by the<br />

system is 0.6954; METEOR score achieved is 0.8583 and F-score of 0.8650.<br />

Keywords: Neural network, back-propagation, rule based translation, English, Urdu, machine translation<br />

system, Artificial Intelligence<br />

(Received June 4th, 2011 / Accepted September 15th, 2011)<br />

1 Introduction<br />

Machine translation, also referred as MT, is the process<br />

of translating one natural language (as English) text to<br />

another natural language (as Urdu) text by the use of<br />

computing machine. Machine Translation is an automated<br />

process in which translation job is done by the<br />

Computer Software. Machine Translation is an application<br />

of computer linguistic. Computer linguistic is an<br />

interdisciplinary field of computer science and requires<br />

language and computer experts. Translation as an art<br />

of ren<strong>de</strong>ring a work of one language into another is as<br />

old as written literature [1]. As the needs of multilingual<br />

information are increasing in business, industries<br />

and economics, machine translation cannot be ignored.<br />

If MT researchers are able to <strong>de</strong>velop a perfect multilingual<br />

machine translation system, people with different<br />

languages can share i<strong>de</strong>as and information worldwi<strong>de</strong><br />

on every topic as research, political, business, economical,<br />

and socio-cultural etc. The purpose of a translation<br />

process whether machine translation or human translation<br />

is that meaning of the text being translated should<br />

not change. There are many different machine translation<br />

system available online as well as <strong>de</strong>sktop systems.<br />

G.R. Tahir, S. Asghar and N. Masood in [21] analyze<br />

the results from most popular MT systems like Babylon<br />

8, World-lingo, PakTranslations, ApniUrdu and MT by<br />

FAST-NU and find out that the translation result is ambiguous<br />

and have wrong sense of meaning. Many languages<br />

spoken in the <strong>de</strong>veloping countries have been<br />

ignored by the researchers though these languages are<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 37<br />

spoken by a large population [7]; it holds the same status<br />

for Urdu language also.<br />

Urdu language is one of the languages from the<br />

family of Indo-Aryan languages. There are some 210<br />

languages and dialects in the family of Indo-Aryan<br />

languages [17]. Urdu is closely related to Hindi with<br />

a similar grammatical structure, but differences in<br />

script and vocabulary [2]. Hindi and Urdu are sister<br />

languages having many common linguistic features<br />

[6]. They are structurally very close to each other and<br />

use similar postpositions, verb morphology as well as<br />

complex predicate verb structure. There are between<br />

60 and 70 million self-i<strong>de</strong>ntified native speakers of<br />

Urdu in different continents. English has its own<br />

importance with respect to international language;<br />

and is a knowledge containing language [3]. A good<br />

translator will remove this gap and people will be able<br />

to communicate without any language barrier.<br />

1.1 Literature survey<br />

The machine translation work in English to Urdu machine<br />

translation is substantially lagging in spite of<br />

large population of Urdu speakers. The English to<br />

Urdu machine translation system <strong>de</strong>veloped by Tafseer<br />

Ahmed, Sa<strong>da</strong>f Alvi in [19] uses transfer based approach<br />

and bottom up chart parsing for English-Urdu translation<br />

task. An expert system based English-Urdu machine<br />

translation work in [11] relies on QTAG for part<br />

of speech tagging and uses knowledge base for grammatical<br />

patterns and gen<strong>de</strong>r aware dictionary. Maryam<br />

Zafar et al in [25] <strong>de</strong>veloped an interactive machine<br />

translation system using Example based approach. This<br />

system uses Levenshtein algorithm and semantic distance<br />

algorithm for searching bilingual corpus. System<br />

uses n-ary product for listing all the possible translations<br />

for the input sentence. System has rules for or<strong>de</strong>ring<br />

the translated text and also supports homograph,<br />

idioms and some other linguistic features. The work<br />

discussed in [10] is a bidirectional English-Urdu machine<br />

translation system with natural language processing.<br />

This system uses rule based methodology with<br />

bottom up parsing and dynamic dictionary for translation.<br />

AGHAZ [13] is an Expert System based automatic<br />

translator for English to Urdu machine translation.<br />

It has an expert system, patterns or rules and a<br />

rich knowledge base which stores English words with<br />

their Urdu meaning, part of speech, gen<strong>de</strong>r, number<br />

and multi-word information. In a work of English to<br />

Urdu translation, R M K Sinha in [18] uses his English-<br />

Hindi MT System as a mo<strong>de</strong>l to translate Urdu from English.<br />

This English-Hindi MT system is built by using<br />

rule based approach and a pseudo Interlingua. In this<br />

work, a Hindi-Urdu mapping table is used which stores<br />

Urdu meaning of Hindi words and information that affect<br />

the composition of Urdu text; to generate Urdu text<br />

from the Hindi output of this system. Sampark in [22]<br />

is a machine translation system for automated machine<br />

translation among Indian languages including Urdu, <strong>de</strong>veloped<br />

by the Consortium of institutions inclu<strong>de</strong> IIIT<br />

Hy<strong>de</strong>rabad, University of Hy<strong>de</strong>rabad, KBC, Chennai,<br />

IIT Kharagpur, CDAC (Noi<strong>da</strong>,Pune), Anna University,<br />

IIT Kanpur, IISc Bangalore, IIIT Alahabad, Ja<strong>da</strong>vpur<br />

University, Tamil University [22]. This system uses<br />

hybrid methodology which consists of rule based approach<br />

and dictionaries and statistical machine learning<br />

techniques. A proposed knowledge based machine<br />

translation system in [21] is an enhancement of Sampark<br />

mo<strong>de</strong>l which consi<strong>de</strong>rs most of the types of ambiguities<br />

and uses text mining and <strong>da</strong>ta mining techniques<br />

for machine translation. A brief overview of English-<br />

Urdu machine translation works discussed here is given<br />

below table (to see Table 1).<br />

Our English to Urdu machine translation system<br />

works at paragraph level as well as for a single sentence.<br />

When a source language text is entered in the<br />

system as input, system processes the text into sentences.<br />

Then each sentence is translated and rearranged<br />

to generate the Urdu translation. First of all, contraction<br />

removal module removes contraction from all the<br />

sentences. Then each sentence is parsed and tagged.<br />

The output of parser and tagger are processed to extract<br />

all the information related to each word present in<br />

the sentence and now each word is transformed into an<br />

object which contains information (like part of speech,<br />

<strong>de</strong>pen<strong>de</strong>ncy, word position in the sentence etc.) about<br />

this word and sentence is transformed into a group of<br />

knowledgeable objects. Now these objects are given to<br />

the grammar analysis and sentence structure recognition<br />

module which processes the information and recognizes<br />

the grammar tokens (like subject, object, verb,<br />

infinitive, gerund etc.) of the sentence and generate<br />

the grammatical structure using the rule base. Artificial<br />

Neural Network (ANN) and Rule based sentence structure<br />

mapping module maps this grammatical structure<br />

to corresponding Urdu grammar structure and ANN<br />

based Urdu word mapping module maps each word<br />

from the each sentence part to the Urdu word. Each<br />

part is now arranged according to the Urdu grammatical<br />

structure obtained from ANN and Rule based sentence<br />

structure mapping module. Syntax addition module<br />

adds verb marker and case markers based on the information<br />

attached with Urdu words and in knowledgeable<br />

objects. Translation of each sentence is generated<br />

and presented in Romanized Urdu.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 38<br />

Table 1: Overview of English-Urdu machine Translation Works /<br />

Systems<br />

S.<br />

No.<br />

System/<br />

W ork(Y ear)<br />

1. English<br />

to Urdu<br />

Translation<br />

System<br />

(2002)<br />

2. Expert system<br />

driven<br />

approach<br />

to generate<br />

natural<br />

language<br />

(2003)<br />

3. Urdu Translation<br />

Engine<br />

(2004)<br />

4. AGHAZ<br />

(2005)<br />

5. Interactive<br />

English-<br />

Urdu<br />

machine<br />

translation<br />

(2009)<br />

6. English-<br />

Urdu<br />

Machine<br />

Translation<br />

Via Hindi<br />

(2009)<br />

7. Sampark (<br />

2009 )<br />

8. Knowledge<br />

based<br />

Machine<br />

Translation<br />

System<br />

(2010)<br />

ResearchT eam W ork/System<br />

Methodology<br />

Tafseer Ahmed,<br />

Sa<strong>da</strong>f Alvi<br />

Expert system<br />

driven approach<br />

to generate natural<br />

language<br />

(2003)<br />

Transfer based approach,<br />

Bottom Up<br />

Chart Parsing<br />

Expert system based<br />

approach, QTAG,<br />

knowledge base for<br />

grammatical patterns<br />

and gen<strong>de</strong>r aware<br />

dictionary<br />

Mohammad Natural language<br />

Kashif Shaikh, processing, rule<br />

Hussain Hy<strong>de</strong>r based, bottom up<br />

Ali Khowaja, parsing and dynamic<br />

Muzammil dictionary Bidirectional<br />

Ahmed Khan<br />

English-Urdu<br />

machine translation<br />

Uzair Muhammad,<br />

Expert System based<br />

Kashif Bi-<br />

approach, knowledge<br />

lal, Atif Khan, base for grammatical<br />

and M. Nasir patterns and gen<strong>de</strong>r<br />

Khan<br />

aware dictionary,<br />

Handles multiple<br />

words and proper<br />

noun<br />

Maryam Zafar Example based approach,<br />

et al<br />

Levenshtein<br />

and semantic distance<br />

algorithm, is N-ary<br />

Product, or<strong>de</strong>ring<br />

rules Supports homograph,<br />

idioms and<br />

some other features.<br />

R. M. K. Sinha Mapping of Hindi<br />

output from English-<br />

Hindi MT system<br />

which is based upon<br />

PLIL (pseudo Lingua<br />

for Indian Languages)<br />

and Rule based<br />

approach.<br />

Sampark<br />

machine translation<br />

Team-<br />

Consortium of<br />

Institutions<br />

Ghulam Rasool<br />

Tahir, Sohail<br />

Asghar, Nayyer<br />

Masood<br />

Sampark machine<br />

translation Team-<br />

Consortium of Institutions<br />

Text mining and Data<br />

mining techniques;<br />

Focuses on adding<br />

semantics.<br />

The further work discussed in this paper is divi<strong>de</strong>d<br />

into the following sections: The second section of this<br />

paper gives a brief overview of linguistic characteristics<br />

of Urdu language. Third section comprises the discussion<br />

about our proposed work, our system architecture<br />

and <strong>de</strong>scription. This section also discusses encoding<strong>de</strong>coding<br />

and neural network module. Software implementation<br />

of the system and working of our system is<br />

explained in the fourth section. Then we discuss results<br />

and evaluation of our system. Last section is conclusion<br />

and future work.<br />

2 Linguistic characteristics of Urdu<br />

2.1 Origin and Vocabulary<br />

Among all the languages in the world, Urdu is most<br />

closely similar to Hindi. Both the languages Hindi and<br />

Urdu have originated from the Delhi region dialect and<br />

other than the minute <strong>de</strong>tails, these languages share<br />

their morphology. Hindi language has adopted many<br />

words from Sanskrit while Urdu language has borrowed<br />

a large number of its vocabulary items from Persian and<br />

Arabic. Urdu has also borrowed words from Turkish,<br />

Portuguese and English [5]. There are a large number<br />

of words which have found a place in Urdu Language,<br />

from the Persian; have differently nuanced connotations<br />

and usages [14].<br />

2.2 Grammar Structure<br />

One of the most significant aspects of Urdu language<br />

grammar structure is its word or<strong>de</strong>r which is SOV<br />

(subject, object, and verb). This or<strong>de</strong>r does exhibit<br />

some flexibility as the subject pronouns are frequently<br />

dropped.<br />

2.3 Nouns<br />

Nouns in Urdu Language grammar have two types<br />

of gen<strong>de</strong>r (masculine/feminine), two type of numbers<br />

(singular/plural) and three cases (vocative, direct and<br />

oblique). All nouns in Urdu, when used within a sentence,<br />

will be inflected for number and case. Suffix<br />

specifies gen<strong>de</strong>r on verbs and adjectives in [5]. example:<br />

pagal → pagalpan (madness), ghabrana → ghabrahat<br />

(anxiety) Common suffixes can be used to drive<br />

nouns from other words. These forms are masculine<br />

and feminine nouns. One notable point is that the borrowed<br />

Arabic and Persian plurals form of the noun are<br />

never inflected in Urdu [14].<br />

2.4 Verbs<br />

Verbs in Urdu language have two nonfinite forms, root<br />

and infinitive. The infinitives comprise a verbal stem<br />

and a suffix. The stem may itself comprise verbal root<br />

and suffix. e.g. ana (to come), jana (to go). In this<br />

example a- and ja- are the root and -na is suffix. The<br />

infinitive forms of all verbs are marked masculine from<br />

grammatical point of view. They neither occur in the<br />

plural, nor in the vocative. There are many verbal forms<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 39<br />

of stem having different endings ad<strong>de</strong>d to them to form<br />

the patterns of different verb forms. In Urdu, subjunctive<br />

is the finite verbal form which conveys the week<br />

conjectures on the Urdu part of speaker [14]. Another<br />

two verbal forms that may be finite or nonfinite are the<br />

perfective and imperfective participles. The imperfective<br />

participle ends with -ta,-te,-ti,-tin. In case of perfective<br />

participles, participle ends with e.g -a,-e,-i,-in. But<br />

the situation will be different whenever there is any verbal<br />

stem that ends in a vowel; we have to add a/y before<br />

masculine singular ending [8, 4]. The future verb forms<br />

in Urdu cannot be <strong>de</strong>ci<strong>de</strong>d from the verb stems rather it<br />

is <strong>de</strong>ci<strong>de</strong>d from subjunctive forms. The endings for the<br />

future forms are (e.g. -ga,-ge,-gi) [14]. Common use<br />

of semi auxiliary elements also gives various semantic<br />

connotations [5].<br />

2.5 Post-positions<br />

In Urdu, post positions take place after noun phrase<br />

head which is an absolute contrast to English language<br />

where a variety of elements occur between preposition<br />

and the governed noun. This process has helped to<br />

reach a conclusion that Urdu has a lot of diversity of<br />

cases [5] e.g. genitive, accusative etc.<br />

Our system uses neural network as knowledge base for<br />

storing linguistic rules and also as knowledge bilingual<br />

dictionary. Neural network maps Urdu words/tokens<br />

(such as verb, noun/pronoun etc.) and grammar<br />

structure rules equivalent to English words/tokens and<br />

grammar structure rules. These words/tokens are then<br />

processed, rules are interpreted and all the parts of the<br />

sentence are arranged according to the interpreted rules.<br />

3.1 System Architecture and Description<br />

The block diagram of our English to Urdu Machine<br />

Translation System is shown in figure (to see Figure1).<br />

There are eight main modules such as Contractions<br />

Removal, Parser and Tagger, Knowledge Extraction,<br />

Grammar Analysis and Sentence Structure Recognition,<br />

ANN (Artificial Neural Network) and Rule Based<br />

Sentence Structure Mapping, ANN Based Urdu word<br />

Mapping, Rule Based Syntax Addition and Urdu Sentence<br />

Generation in our System. Working of each module<br />

is explained below.<br />

3 Our proposed work<br />

In our work of English to Urdu machine translation,<br />

we used a neural network and rule based approach.<br />

Rule based approach is the classical approach of<br />

machine translation. In rule based machine translation<br />

approach, system is fed with linguistic rules and<br />

bilingual dictionaries. System parses and analyses the<br />

grammatical structure of the source language text, this<br />

structure is then transformed to the target language<br />

structure with the help of the linguistic rules. When<br />

the structure is transformed, target language text is<br />

generated by the use of bilingual dictionaries and<br />

linguistic rules. Many systems have been <strong>de</strong>veloped<br />

using rule based machine translation, in which main<br />

systems are as Systran, Eurotra and Japanese MT<br />

System. Neural networks are a possible solution to the<br />

machine translation problem. Neural networks have<br />

the ability of learning by examples. Neural network<br />

has proven very useful in various natural language<br />

processing tasks [8]. PARSEC [9], JANUS [24] and<br />

English-Sanskrit MT system [12] use neural network<br />

approach for natural language processing task and<br />

automated machine translation. Our English to Urdu<br />

machine translation system uses Feed-Forward Back-<br />

Propagation Neural Network with rule based machine<br />

translation approach. Neural networks are very efficient<br />

in pattern matching. Machine translation using rule<br />

based approach is consistent and of predictable quality.<br />

Figure 1: System Architecture<br />

Sentence Separator and Contractions Removal: The<br />

translation process starts with English text input to this<br />

module. This module first separates the paragraph into<br />

sentences. Then each sentence is processed. If any contraction<br />

is present in the sentence it is removed. Then<br />

it is passed to the parser and tagger module. Contractions<br />

are common in spoken English and now becoming<br />

informal in written English also. In this step, we<br />

replace contractions with their respective full form. For<br />

example, I’m, you’ve, she’ll and they‘d etc will be replaced<br />

by respectively I am, you have, she will and they<br />

had/would etc. Similarly, negative contractions aren’t,<br />

needn’t, won‘t etc will be replaced by respectively are<br />

not, need not, will not etc.<br />

Parser and Tagger: Processed text from Contraction<br />

Removal module is given as input to the Parser and<br />

Tagger module. Stanford typed <strong>de</strong>pen<strong>de</strong>ncy parser is<br />

used for parsing the English Text. Stanford parser is<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 40<br />

the implementation of probabilistic natural language<br />

parsers, both highly optimized PCFG and lexicalized<br />

<strong>de</strong>pen<strong>de</strong>ncy parsers, and a lexicalized PCFG parser.<br />

Probabilistic parsers use knowledge of language gained<br />

from hand-parsed sentences to try to produce the most<br />

likely analysis of new sentences. These statistical<br />

parsers still make some mistakes, but commonly work<br />

rather well [16]. The parser provi<strong>de</strong>s Stanford typed<br />

<strong>de</strong>pen<strong>de</strong>ncies as output. The output of parser for an<br />

English sentence is shown below:<br />

Stu<strong>de</strong>nts must tell the result to their parents.<br />

nsubj(tell − 3, Stu<strong>de</strong>nts − 1), aux(tell − 3, must −<br />

2), <strong>de</strong>t(result − 5, the − 4), dobj(tell − 3, result −<br />

5), poss(parents − 8, their − 7), prep t o(tell −<br />

3, parents − 8).<br />

We are using Stanford POS tagger for tagging the<br />

English text. A Part-Of-Speech Tagger (POS Tagger)<br />

assigns parts of speech to each word (and other token),<br />

such as noun, verb, adjective, etc. The Stanford POS<br />

tagger uses the Penn Treebank tag set and is implemented<br />

using maximum entropy tagging algorithm<br />

[20]. POS tagger adds part of speech information to<br />

each word (and other tokens) in the text. The output of<br />

tagger for an English sentence is shown below:<br />

Stu<strong>de</strong>nts must tell the result to their parents.<br />

Stu<strong>de</strong>nts/NNS must/MD tell/VB the/DT result/NN<br />

to/TO their/PRP$ parents/NNS.<br />

Knowledge Extraction: The function of this module<br />

is to process the typed <strong>de</strong>pen<strong>de</strong>ncy obtained from parser<br />

and to process tagged text from tagger. This module extracts<br />

information from parser and tagger for each part<br />

of the sentence. Each part of the sentence is converted<br />

to knowledgeable object by adding all the information<br />

associated with it and sentence is represented as a collection<br />

of knowledgeable objects.<br />

Grammar Analysis and Sentence Structure Recognition:<br />

This module processes the collection knowledgeable<br />

objects and recognizes parts of the sentence<br />

e.g. subject, main verb, auxiliary verb, object, indirect<br />

object etc. Tense of the sentence is recognized with the<br />

help of main verb and auxiliary verb. Sentence voice<br />

whether it’s passive or active, is also recognized in this<br />

phase. Sentence type is <strong>de</strong>tected from the knowledge<br />

present in the collection of knowledgeable objects. On<br />

the basis of knowledge obtained, sentence parts and attributes<br />

(tense, voice, type etc.) are analyzed and sentence<br />

grammatical structure is generated with the help<br />

of rule base.<br />

ANN and Rule based sentence structure mapping:<br />

Generated grammatical structure and attributes are<br />

passed to ANN and Rule based sentence structure mapping<br />

module. This module gathers information and<br />

makes a query to obtain the corresponding grammar<br />

structure for target languages i.e. Urdu. This query<br />

is co<strong>de</strong>d into numeric form (<strong>de</strong>cimal number). Artificial<br />

Neural Network (ANN) is trained on a <strong>da</strong>ta set of<br />

<strong>de</strong>cimal enco<strong>de</strong>d Rule Base for English Grammar and<br />

corresponding Urdu Grammar in which, various parts<br />

of the structure are separated by space. On query, ANN<br />

mo<strong>de</strong>l returns Urdu grammar structure corresponding to<br />

the attribute and English grammatical structure knowledge<br />

enco<strong>de</strong>d in the query. The returned structure is<br />

also in the numeric form which is then <strong>de</strong>co<strong>de</strong>d to textual<br />

form for further processing.<br />

ANN Based Urdu word mapping: Sentence parts<br />

(words or tokens) are transformed according to the<br />

Urdu grammar structure obtained from last module.<br />

Now each sentence part has to be translated. Urdu word<br />

mapping module enco<strong>de</strong>s each word into numeric form<br />

and looks for each word in the bilingual ANN mo<strong>de</strong>l<br />

which is trained for word mapping, and gets the corresponding<br />

English word and associated information in<br />

numeric form. This result is <strong>de</strong>co<strong>de</strong>d to textual form<br />

which contains Urdu meaning of the word and coupled<br />

information. For a word, which is noun/pronoun, coupled<br />

information will be the number, person and gen<strong>de</strong>r<br />

and a word which is verb, coupled information will<br />

be its weak verb. Verbs in Neural Network mo<strong>de</strong>l are<br />

trained with their base form meaning and weak verb if<br />

there is any.<br />

3.2 Translation Rules<br />

Translation Rules have been created for various classes<br />

of the sentences. Our system is able to handle all<br />

forms (affirmative, negative and interrogative) of the<br />

English simple sentences. Syntax addition to verb<br />

and case marker addition to subject and object will<br />

be ad<strong>de</strong>d on the basis of information of tense, subject<br />

and object gen<strong>de</strong>r, number and person. For example<br />

for the following sentence: English Sentence: I lent<br />

my pen to a friend. Following translation rule will<br />

be used: IF (Sentence structure is SVOPPO and tense<br />

is Past-In<strong>de</strong>finite and sentence is affirmative in active<br />

voice) THEN (Urdu grammar = subject (S) + object<br />

(O) + prepositional object (PO) + preposition (P) +<br />

verb (V)). Syntax addition: As direct object is present<br />

in the sentence so case marker ’ne’ has to be ad<strong>de</strong>d and<br />

marker ’a’ to verb will also be ad<strong>de</strong>d. This is <strong>de</strong>ci<strong>de</strong>d<br />

on the basis of tense, sentence structure and coupled<br />

information (number, person, gen<strong>de</strong>r) with the Urdu<br />

meaning of the word. Syntax addition rules have been<br />

written for each tense consi<strong>de</strong>ring all cases of number,<br />

gen<strong>de</strong>r, and person and sentence structure. The general<br />

structure for the grammar rules for training neural<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 41<br />

network as follows<br />

I/p → gclass + tense + type + category + voice.<br />

O/p → urdu grammar<br />

E.g. I/p → svo + pastInd + s + aff + act O/p → sov.<br />

Where gclass is the grammar class of sentence like<br />

SVO, tense like Past In<strong>de</strong>finite, type of the sentence<br />

is simple, complex, imperative etc, category is affirmative,<br />

interrogative etc and voice is active or passive.<br />

Translation rules for the following structures of the<br />

sentences have been written SVSc, SV, SVO, SVIoO,<br />

SVIn, SVInIn, SVInO, SVG, SVGO, SVpPO, SVp-<br />

POpPO, SVpPOpPOpPO, SVOpPO, SVOpPOpPO,<br />

SVOpPOpPOpPO; where S = Subject, V = Verb,<br />

Sc = Subject Compliment, Io = Indirect Object, In<br />

= Infinitive, G = Gerund, p = preposition and PO =<br />

Prepositional Object. Some examples of translation<br />

rules as follows:<br />

English Sentence (E.S.): Mr S Khan is a research<br />

scholar<br />

IF (sentence structure is SVSc and tense is present and<br />

affirmative sentence in active voice)<br />

THEN ( Urdu grammar = S + Sc + V)<br />

E.S.: Has the bell rung?<br />

IF (sentence structure is SV and tense is present perfect<br />

and verb interrogative sentence in active voice)<br />

THEN ( Urdu grammar = kya + S + V)<br />

E.S.: The boy hadn’t lost his pen.<br />

IF (sentence structure is SVO and tense is past perfect<br />

and negative sentence in active voice)<br />

THEN ( Urdu grammar = S + O + negative word + V )<br />

E.S.: Why does he not want to go to watch the movie?<br />

IF (sentence structure is SVInInO and tense is present<br />

In<strong>de</strong>finite and interrogative-negative sentence in active<br />

voice)<br />

THEN (Urdu grammar = S + O + In2 + question word<br />

+ negation word + In1 + V).<br />

E.S.: I lent my pen to my friend.<br />

IF (sentence structure is SVOpPO and tense is past<br />

In<strong>de</strong>finite and interrogative-negative sentence in active<br />

voice)<br />

THEN (Urdu grammar = S + O + PO + p + V).<br />

3.3 Enco<strong>de</strong>r-Deco<strong>de</strong>r<br />

We created a <strong>da</strong>ta set of input-output pairs of English-<br />

Urdu words with associated knowledge and another<br />

<strong>da</strong>ta set of input-output pairs of grammar rules.<br />

Enco<strong>de</strong>r-Deco<strong>de</strong>r converts this training <strong>da</strong>ta into numeric<br />

co<strong>de</strong>d form which is suitable to be used as input<br />

for the ANN trainer. Each English alphabet is represented<br />

as a five bit binary number (a = 00001, b =<br />

00002 and so on)(to see Table 2 ). Value of each alphabet<br />

is converted to <strong>de</strong>cimal by dividing 26 (a = 1/26, b=<br />

2/26 and so on) to train the neural network. Some special<br />

characters are also used for correct representation<br />

of a word in Roman Urdu. All the special characters<br />

are assigned values higher than one. For training neural<br />

network, we enco<strong>de</strong> each character of the words/tokens<br />

and grammar structure to numeric form as explained<br />

above.<br />

Table 2: English Alphabet Encoding<br />

S.No. Alphabet 5 − bit<br />

binary<br />

Decimalco<strong>de</strong><br />

forthe<br />

alphabet<br />

(binary/26)<br />

1. a 00001 0.038462<br />

2. b 00010 0.076923<br />

3. c 00011 0.115385<br />

4. d 00100 0.153846<br />

5. e 00101 0.192308<br />

6. f 00110 0.230769<br />

7. g 00111 0.269231<br />

8. h 01000 0.307692<br />

9. i 01001 0.346154<br />

10. j 01010 0.384615<br />

11. k 01011 0.423077<br />

12. l 01100 0.461538<br />

13. m 01101 0.500000<br />

14. n 01110 0.538462<br />

15. o 01111 0.576923<br />

16. p 10000 0.615385<br />

17. q 10001 0.653846<br />

18. r 10010 0.692308<br />

19. s 10011 0.730769<br />

20. t 10100 0.769231<br />

21. u 10101 0.807692<br />

22. v 10110 0.846154<br />

23. w 10111 0.884615<br />

24. x 11000 0.923077<br />

25. y 11001 0.961538<br />

26. z 11010 1.000000<br />

27. a (bar) 11011 1.038461<br />

28. e (bar) 11100 1.076923<br />

29. i (bar) 11101 1.115384<br />

30. n (acute) 11110 1.153846<br />

31. u (bar) 11111 1.192307<br />

32. Space 00000 0<br />

3.4 Neural Network and Training<br />

We have created a two-layer feed-forward neural<br />

network. First layer in this network is sigmoid and<br />

second layer is linear. We trained this network with<br />

Levenberg-Marquardt algorithm. There are many<br />

numerical optimization techniques to speed up the<br />

convergence of back-propagation algorithm. Different<br />

algorithms perform differently for a given problem.<br />

The results, presented in [4], show that Levenberg-<br />

Marquardt algorithm is very efficient for training the<br />

networks having up to a few hundred weights. We have<br />

trained neural network for grammar structure rules with<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 42<br />

a <strong>da</strong>ta set of around 465 input-output pair of grammar<br />

rules. The input layer of grammatical structure network<br />

contains 42 no<strong>de</strong>s, hid<strong>de</strong>n layer contains 100 no<strong>de</strong>s<br />

and output layer contains 30 no<strong>de</strong>s. Mean squared<br />

error goal was set to training error of 10 −8 which<br />

was achieved after 29 epochs. The neural network for<br />

knowledgeable bilingual dictionary has been trained<br />

with a <strong>da</strong>ta set of around 9000 input-output pair of<br />

English-Urdu words with associated knowledge. The<br />

input layer of bilingual dictionary network contains<br />

10 no<strong>de</strong>s, hid<strong>de</strong>n layer contains 100 no<strong>de</strong>s and output<br />

layer contains 32 no<strong>de</strong>s (for meaning and other information).<br />

Mean squared error goal was set to training<br />

error of 10 −8 which was achieved after 333 epochs.<br />

3.4.1 ANN Based Mapping Process<br />

We used feed-forward back-propagation artificial<br />

neural network for the selection of Urdu words/tokens<br />

(such as verb, noun/pronoun etc) and grammar structure<br />

rules equivalent to English words/tokens and<br />

grammar structure rules. There are three main steps in<br />

mapping process as follows:<br />

1) Encoding of English words/tokens or grammar<br />

structure to numeric co<strong>de</strong>.<br />

2) Mapping of English numeric co<strong>de</strong>: Data sets are fed<br />

to Neural Network from which ANN selects the Urdu<br />

equivalent of the English words/tokens or grammar<br />

structure provi<strong>de</strong>d for Translation.<br />

3) Decoding the co<strong>de</strong> of the obtained Urdu<br />

words/tokens or grammar structure.<br />

Once we get the equivalent words/tokens or grammar<br />

structure, Urdu meaning and information is extracted<br />

and processed.<br />

noun, pronoun, number, person and gen<strong>de</strong>r. The neural<br />

networks mo<strong>de</strong>l for grammar structure rules gives the<br />

Urdu equivalent grammatical structure to English sentence<br />

being translated and the neural mo<strong>de</strong>l for bilingual<br />

knowledgeable dictionary gives the Urdu equivalent<br />

word and associated knowledge about the word. A<br />

java class does coding and <strong>de</strong>coding of the tokens and<br />

linguistic rules and gives to the neural networks as input<br />

for mapping them to their equivalent Urdu tokens<br />

and linguistic rules. To automate the process we created<br />

a java class for creating training <strong>da</strong>ta in numeric form<br />

with help of coding and <strong>de</strong>coding java class from a text<br />

file where <strong>da</strong>ta is present in human rea<strong>da</strong>ble form as a<br />

word in numeric form is difficult to read by a human but<br />

easy for a program. Neural network then maps these numeric<br />

values and produces equivalent result in numeric<br />

form which are then again passed to the java class which<br />

<strong>de</strong>co<strong>de</strong>s numeric <strong>da</strong>ta and present in the string form.<br />

This knowledge is further processed and Urdu meaning<br />

and attached information is extracted. Suffix in the<br />

verb and marker with the subject are attached on the<br />

basis of knowledge obtained from the neural network<br />

and information obtained in the Grammar Analysis and<br />

Sentence Structure Recognition module. These parts<br />

are then arranged according to the grammar structure<br />

obtained from grammatical structure network and the<br />

output is presented in Romanized Urdu form.<br />

5 Results and Evaluation<br />

Our system is also able to handle contractions if present<br />

in the English input text figure 2 (to see Figure2).<br />

4 Implementation<br />

We have implemented our English-Urdu machine translation<br />

system on java platform. We used java jdk1.5<br />

version for its compatibility with Matlab 7.1. System<br />

is implemented in java except from the neural network<br />

module. Neural network mo<strong>de</strong>l is trained, tested and<br />

successfully implemented using Matlab 7.1 neural network<br />

library. Neural network works as the knowledge<br />

base for linguistic rules and bilingual dictionary. Bilingual<br />

dictionary does not only store the meaning of English<br />

word in Urdu but also store linguistic knowledge<br />

(e.g. verb, noun, pronoun, number, person and gen<strong>de</strong>r<br />

etc) attached to the Urdu word. We trained the<br />

two-layer feed-forward neural network with Levenberg-<br />

Marquardt back-propagation algorithm. We created<br />

two separate neural networks one for grammar structure<br />

rules and one for English-Urdu bilingual knowledge<br />

dictionary as Urdu equivalent of English words also<br />

have associated knowledge about the word like verb,<br />

Figure 2: Contraction Removal<br />

The output of Contraction Removal module is<br />

passed to the Parser and Tagger module which uses<br />

Stanford parser and tagger for parsing and tagging the<br />

input English sentence. The output of the Parser and<br />

Tagger module is shown in the figure 3 (to see Figure3).<br />

Figure 3: Parser and Tagger Output<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 43<br />

Knowledge extraction module processes the result<br />

obtained from Parser and Tagger module and converts<br />

each part of the sentence to a knowledgeable object by<br />

adding all the information associated with it. Sentence<br />

is now represented as a collection of knowledgeable<br />

objects which are then given as input to the Grammar<br />

Analysis and Sentence Structure Recognition module.<br />

This module analyzes these objects and i<strong>de</strong>ntifies the<br />

attributes of the grammar for the English sentence as<br />

tense, voice, sentence type, subject, main verb, auxiliary<br />

verb, object, indirect object etc. Now each token<br />

and grammatical structure is mapped from the neural<br />

network as explained earlier in the implementation section.<br />

Verbs meaning are stored in the base form so suffix<br />

has to be ad<strong>de</strong>d according to the tense, gen<strong>de</strong>r and<br />

number of the subject or object sometimes which are<br />

appen<strong>de</strong>d on the basis of knowledge obtained from the<br />

neural network and tense of the sentence. Case marker<br />

words like ka, ke, ko, ne, ki etc also attached with the<br />

subject on the basis of knowledge obtained from the<br />

neural network and information obtained in the Grammar<br />

Analysis and Sentence Structure Recognition module.<br />

All the parts of the sentence are then arranged according<br />

to the grammar structure rule obtained from<br />

grammatical structure network and the output is presented<br />

in Romanized Urdu form as below:<br />

Input English Text: Ram Kumar Singh is a stu<strong>de</strong>nt.<br />

He lives in Shimla. Shimla offers you refreshing environment.<br />

He enjoys playing cricket. He likes singing.<br />

He went to the market with his father. He saw an old<br />

man in the market. The old man was buying a book for<br />

his wife from the market. He bought a pen for his sister.<br />

He met his friends. They wanted to go to watch the<br />

movie. He <strong>de</strong>ci<strong>de</strong>d to watch the movie.<br />

Output Urdu Translation: RAM KUMAR SINGH ek<br />

talib-e-ilm hai | wah SHIMLA me rahta hai | SHIMLA<br />

tumko tazagi bhara mahaul <strong>de</strong>ta hai | wah cricket<br />

khelna lutf uthata hai | wah gana pasand karta hai |<br />

wah apne walid ke sath bazar ko gaya tha | wah bazar<br />

me ek boodha a<strong>da</strong>mi <strong>de</strong>kha tha | boodha a<strong>da</strong>mi bazar<br />

se apni biwi ke liye ek kitaab kharid raha tha | wah apni<br />

bahan ke liye ek kalam khari<strong>da</strong> tha | wah apne doston<br />

mila tha | ve film <strong>de</strong>khna jana chahate the | wah film<br />

<strong>de</strong>khna faisla kiya tha |<br />

The words which are not present in the bilingual<br />

dictionary are printed as it is in the translation in<br />

capitals.<br />

5.1 Evaluation<br />

The problem of evaluation is same as the problem of<br />

translation. Various methods have been employed for<br />

evaluating the quality of machine translation output.<br />

Some features can be evaluated automatically for example<br />

fluency can be checked by n-gram analysis of<br />

reference translations are available and some can’t as<br />

meaning sense of translation. It is hard to compare between<br />

two different Machine Translation algorithms objectively.<br />

The evaluation scores for twenty-eight randomly selected<br />

sentences [shown in table 4,5 (to see 4 and 5 )] of<br />

various classes are shown in the table 3 (to see 3) below.<br />

In these tables 4 and 5 sentence mean English sentence,<br />

candi<strong>da</strong>te is the translation output of our machine translation<br />

system and reference is the Urdu translation of<br />

the English sentence by a human expert.<br />

Table 3: Calculated score for the sentences shown in table 4, 5<br />

S.No. BLEU P R M F<br />

1 1.0000 1.0000 1.0000 0.9998 1.0000<br />

2 1.0000 1.0000 1.0000 0.9993 1.0000<br />

3 1.0000 1.0000 1.0000 0.9995 1.0000<br />

4 0.8105 1.0000 1.0000 0.9995 1.0000<br />

5 0.4544 0.5556 0.5556 0.5533 0.5556<br />

6 0.4137 0.7500 0.7500 0.7361 0.7500<br />

7 0.8092 0.9091 0.9091 0.9055 0.9091<br />

8 0.6776 0.8889 0.8889 0.8880 0.8889<br />

9 0.3119 0.7143 0.7143 0.6371 0.7143<br />

10 0.3708 0.8333 0.8333 0.8067 0.8333<br />

11 1.0000 1.0000 1.0000 0.9990 1.0000<br />

12 0.5435 0.8571 0.8571 0.8552 0.8571<br />

13 0.4208 0.8333 0.8333 0.8300 0.8333<br />

14 1.0000 1.0000 1.0000 0.9985 1.0000<br />

15 0.5630 0.8889 0.7273 0.7212 0.8000<br />

16 0.5667 0.8333 0.8333 0.8300 0.8333<br />

17 0.5667 0.8333 0.8333 0.8300 0.8333<br />

18 1.0000 1.0000 1.0000 0.9960 1.0000<br />

19 0.7140 0.8750 0.7778 0.7773 0.8235<br />

20 0.8101 0.8571 0.8750 0.8630 0.8660<br />

21 0.8914 1.0000 0.9000 0.9041 0.9474<br />

22 0.2762 0.5714 0.5714 0.5670 0.5714<br />

23 0.8914 1.0000 1.0000 0.9993 1.0000<br />

24 1.0000 1.0000 1.0000 0.9977 1.0000<br />

25 1.0000 1.0000 1.0000 0.9977 1.0000<br />

26 1.0000 1.0000 1.0000 0.9922 1.0000<br />

27 1.0000 1.0000 1.0000 0.9977 1.0000<br />

28 1.0000 1.0000 1.0000 0.9985 1.0000<br />

BLEU in [15] (Bilingual Evaluation Un<strong>de</strong>rstudy) is<br />

an IBM-<strong>de</strong>veloped metric, uses a modified form of precision<br />

(modified n-gram precision) to compare the candi<strong>da</strong>te<br />

translation against reference translations. It takes<br />

the geometric mean of modified precision scores of the<br />

test corpus and then multiplies the result by exponential<br />

brevity penalty factor to give the BLUE score. Modified<br />

precision score can be calculated as follows:<br />

p n = Σ C∈{ C andi<strong>da</strong>tes}Σ n −gram∈ C Count c lip(n−gram)<br />

Σ Ć ∈{ C andi<strong>da</strong>tes}Σ n−gram∈ ´ Ć Count c lip( n−gram) ´<br />

Where C is the set of candi<strong>da</strong>te translation sentences<br />

and C’ is the set of reference sentences. Count clip in<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 44<br />

Table 4: Twenty-eight randomly selected sentences<br />

Table 5: Twenty-eight randomly selected sentences<br />

S.No. Sentence, Candi<strong>da</strong>teandReference<br />

1. Sentence: Why has he bought a watch for his sister<br />

from the market?<br />

Candi<strong>da</strong>te: wah bazar se apni bahan ke liye ek ghadi<br />

kyon kharid chuka hai<br />

Reference : wah bazar se apni bahan ke liye ek ghadi<br />

kyon kharid chuka hai<br />

2. Reference : wah bazar se apni bahan ke liye ek ghadi<br />

kyon kharid chuka hai<br />

Candi<strong>da</strong>te: la<strong>da</strong>ka SALESMAN se ek kitaab kyon<br />

kharid raha tha<br />

Reference: la<strong>da</strong>ka salesman se ek kitaab kyon kharid<br />

raha tha<br />

3. Sentence: The girl was singing a song with her<br />

friends.<br />

Candi<strong>da</strong>te: la<strong>da</strong>ki apne doston ke sath ek gana ga rahi<br />

thi<br />

Reference: la<strong>da</strong>ki apne doston ke sath ek gana ga rahi<br />

thi<br />

4. Sentence: Why did the teacher give homework to us?<br />

Candi<strong>da</strong>te: ustad hamko ko ghar ke liye kam kyon<br />

diya tha<br />

Reference: ustad ne hamko ghar ke liye kam kyon<br />

diya tha<br />

5. Sentence: I bought 10kg mango for my sister.<br />

Sentence: I bought 10kg mango for my sister.<br />

Sentence: I bought 10kg mango for my sister.<br />

6. Sentence: I lent my pen to a friend.<br />

Candi<strong>da</strong>te: mai ek dost ko mera kalam diya tha<br />

Reference: maine ek dost ko apna kalam diya tha<br />

7. Sentence: Why did he not go to the market with his<br />

friends?<br />

Candi<strong>da</strong>te: wah apni doston ke sath bazar ko kyon<br />

nahi jata hai<br />

Reference: wah apne doston ke sath bazar ko kyon<br />

nahi jata hai<br />

8. Sentence: He went to the market with his friends.<br />

Candi<strong>da</strong>te: wah apni doston ke sath bazar ko gaya tha<br />

Reference: wah apni doston ke sath bazar ko gaya tha<br />

9. Sentence: These books belong to me.<br />

Candi<strong>da</strong>te: yen kitaben mujh ko talluk rakhta hai<br />

Reference: yen kitaben mujh se talluk rakhti hai<br />

10. Sentence: I like reading books.<br />

Candi<strong>da</strong>te: mai padh kitaben pasand karta hun<br />

Reference: mai kitaben padhna pasand karta hun<br />

11. Sentence: Has he finished working?<br />

Candi<strong>da</strong>te: Kya wah kam karna khatm kar chuka hai<br />

Reference: Kya wah kam karna khatm kar chuka hai<br />

12. Sentence: Where does he want to go to see the movie?<br />

Candi<strong>da</strong>te: wah film <strong>de</strong>khna kahaan jana chahta hai<br />

Reference: wah film <strong>de</strong>khne kahaan jana chahta hai<br />

13. Sentence: He wants to go to see the movie.<br />

Candi<strong>da</strong>te: wah film <strong>de</strong>khna jana chahta hai<br />

Reference: wah film <strong>de</strong>khne jana chahta hai<br />

this equation is calculated as Countclip = min (Count,<br />

Max Ref Count). The formula for calculating brevity<br />

penalty is<br />

BP = 1 if c >r ; BP = e (1−r/c) if c ≤ r<br />

Where r is the length of reference and c is the length of<br />

S.No. Sentence, Candi<strong>da</strong>teandReference<br />

14. Sentence: That man wishes to buy a car.<br />

Candi<strong>da</strong>te: vah a<strong>da</strong>mi ek car kharidna chahta hai<br />

Reference: vah a<strong>da</strong>mi ek car kharidna chahta hai<br />

15. Sentence: Has he <strong>de</strong>ci<strong>de</strong>d to visit the museum?<br />

Candi<strong>da</strong>te: Kya wah mueseum <strong>da</strong>ura karna faisla kar<br />

chuka hai<br />

Reference: Kya wah mueseum ka <strong>da</strong>ura karne ka faisla kar<br />

chuka hai<br />

16. Sentence: Where does he want to go to play?<br />

Candi<strong>da</strong>te: wah kahaan khelna jana chahta hai<br />

Candi<strong>da</strong>te: wah kahaan khelna jana chahta hai<br />

.17 Sentence: Why does he not want to play?<br />

Candi<strong>da</strong>te: wah kyon khelna nahi chahta hai<br />

Reference: wah kyon khelna nahi chahta hai<br />

18. Sentence: My friend wants to go.<br />

Candi<strong>da</strong>te: mera dost jana chahta hai<br />

Reference: mera dost jana chahta hai<br />

19. Sentence: Why the old man did not tell us the truth?<br />

Candi<strong>da</strong>te: boodha a<strong>da</strong>mi hamko sach kyon nahi bataya<br />

tha<br />

Reference: boodhe a<strong>da</strong>mi ne hamko sach kyon nahi bataya<br />

tha<br />

20. Sentence: Why did the old man buy a watch?<br />

Candi<strong>da</strong>te: boodha a<strong>da</strong>mi ek ghadi kyon khari<strong>da</strong> tha<br />

Reference: boodhe a<strong>da</strong>mi ne ek ghadi kyon kharidi thi<br />

21. Sentence: The teacher did not give us homework.<br />

Candi<strong>da</strong>te: ustad hamko ghar ke liye kam nahi diya tha<br />

Reference: ustad ne hamko ghar ke liye kam nahi diya tha<br />

22. Sentence: Shimla offers you refreshing environment.<br />

Candi<strong>da</strong>te: SHIMLA tumko tazagi bhara mahaul <strong>de</strong>ta hai<br />

Reference: Shimla tumko tazagi bhara mahaul <strong>de</strong>ta hai<br />

23. Sentence: Have I given you my pen?<br />

Candi<strong>da</strong>te: Kya mai tumko mera kalam <strong>de</strong> chuka hun<br />

Reference: Kya mai tumko apna kalam <strong>de</strong> chuka hun<br />

24. Sentence: The boy has lost his pen.<br />

Candi<strong>da</strong>te: la<strong>da</strong>ka apni kalam kho chuka hai<br />

Reference: la<strong>da</strong>ka apni kalam kho chuka hai<br />

25. Sentence: What these boys were doing?<br />

Candi<strong>da</strong>te: yen la<strong>da</strong>ken kya kar rahe the<br />

Reference: yen la<strong>da</strong>ken kya kar rahe the<br />

26. Sentence: Do the birds fly?<br />

Candi<strong>da</strong>te: Kya chidiyan u<strong>da</strong>ti hain<br />

Reference: Kya chidiyan u<strong>da</strong>ti hain<br />

27. Sentence: The old man was working.<br />

Candi<strong>da</strong>te: boodha a<strong>da</strong>mi kam kar raha tha<br />

Reference: boodha a<strong>da</strong>mi kam kar raha tha<br />

28. Sentence: Mr S Khan is a research scholar.<br />

Candi<strong>da</strong>te: MR S KHAN ek taftish alam hai<br />

Reference: Mr S Khan ek taftish alam hai<br />

candi<strong>da</strong>te; Then Bleu score is calculated as:<br />

BLUE = BP.exp(Σw n logp n )<br />

Precision in [23] is the fraction of correct instances<br />

among those that the algorithm believes to belong to<br />

the relevant subset. Precision can be calculated as: P =<br />

| X ∩ Y | / | Y | Where Y is the set of candi<strong>da</strong>te items<br />

and X is the of reference items.<br />

Recall in [23] is the fraction of correct instances among<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 45<br />

all instances that actually belong to the relevant subset.<br />

Recall can be calculated as: R = | X ∩ Y | / | X | Where<br />

Y is the set of candi<strong>da</strong>te items and X is the of reference<br />

items.<br />

METEOR (Metric for Evaluation of Translation with<br />

Explicit OR<strong>de</strong>ring) is a machine translation evaluation<br />

metric <strong>de</strong>veloped at Carnegie Mellon University. The<br />

Meteor metric is based on the weighted harmonic mean<br />

of unigram precision ( P = m/w t ) and unigram recall<br />

( P = m/w r ). Where m is number of unigrams, w t is<br />

the number of unigrams in candi<strong>da</strong>te translation and w r<br />

is the reference translation. Precision and Recall are<br />

combined using the harmonic mean with recall 9 times<br />

more than precision: F mean = 10PR / 9P + R This measure<br />

is for congruity with respect to single words but for<br />

consi<strong>de</strong>ring longer n-gram matches, a penalty p is calculated<br />

for the alignment as: p = 0.5 ( c / u m ) 3 ; Where<br />

c is the number of chunks, and u m is the number of<br />

unigrams that have been mapped. The more mappings<br />

there are that are not adjacent in the reference and the<br />

candi<strong>da</strong>te sentence, the higher the penalty will be. Final<br />

Meteor-score (M-score) is calculated as:<br />

M = F mean (1-p).<br />

F-Measure in [23] is a metric <strong>de</strong>veloped on the New<br />

York University. The F-measure is <strong>de</strong>fined as the harmonic<br />

mean of precision and the recall as:<br />

F-measure = (2 * Precision * Recall) / ( Precision + Recall).<br />

The comparative scores of different Machine Translation<br />

evaluation methods such as BLEU (BiLingual<br />

Evaluation Un<strong>de</strong>rstudy), METEOR (M), F-measure (F)<br />

scores, unigram Precision (P), unigram Recall (R) for<br />

thirty-seven randomly selected sentences of various<br />

classes are shown in figure 4 (to see Figure4).<br />

It has been seen from the results that system performs<br />

efficiently on those classes of sentences whose<br />

grammar rules are trained in the neural network. System<br />

uses Stanford Parser for typed <strong>de</strong>pen<strong>de</strong>ncy and Tagger<br />

for POS-tagging; if the parser or tagger makes an<br />

error for any sentence then same error will be propagated<br />

throughout the translation and will result in the<br />

wrong translation. We obtained an average BLUE score<br />

of 0.6954, M-score of 0.8583 and F-score of 0.8650.<br />

6 Conclusion and Future Work<br />

The working and architecture of our English to Urdu<br />

Machine translation system is discussed in this paper.<br />

All the modules have been implemented successfully.<br />

This paper <strong>de</strong>scribes the use of neural network with<br />

rule based machine translation approach. Our system<br />

uses neural network for dictionary lookups and grammar<br />

structure mapping and suffix addition to verbs and<br />

Figure 4: Evaluation Scores for randomly selected sentences<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 46<br />

case marker addition with subject does not require any<br />

dictionary lookups, though it is done on the basis of<br />

information attached with the words; which makes it<br />

efficient and fast. Our system works efficiently on the<br />

sentences for which grammar rules are present in the<br />

rule base and words which are available in the bilingual<br />

dictionary. If the word is not present in the dictionary,<br />

English word is printed as it is in the translation in capitals.<br />

The translation results obtained from the system<br />

evaluated using machine evaluation methods and manually<br />

and it has seen that the system works efficiently<br />

on the trained linguistic rules and bilingual dictionary.<br />

The n-gram blue score obtained for the system over 100<br />

sentences is 0.6954; METEOR score achieved is 0.8583<br />

and F-score of 0.8650. So an enhancement to the grammar<br />

rules and size of bilingual dictionary will lead to<br />

the efficient and accurate machine translation system.<br />

References<br />

[1] Abdullah, P. and Homie<strong>da</strong>n, H. Machine translation,<br />

1997.<br />

[10] Kashif Shaikh, M., Ali Khowaja, H., and<br />

Ahmed Khan, M. Urdu text translation with natural<br />

language processing. In Engineering, Sciences<br />

and Technology, Stu<strong>de</strong>nt Conference On, pages 81<br />

– 85, 2004.<br />

[11] Khan, S., Pervez, Z., Mahmood, M., Mustafa, F.,<br />

and Hasan, U. An expert system driven approach<br />

to generating natural language in romanized urdu<br />

from english documents. In Multi Topic Conference,<br />

2003. INMIC 2003. 7th International, pages<br />

361 – 366, 2003.<br />

[12] Mishra, V. and Mishra., R. Ann and rule based<br />

mo<strong>de</strong>l for english to sanskrit machine translation.<br />

<strong>INFOCOMP</strong> Journal of Computer Science,<br />

9(1):80–89, 2010.<br />

[13] Muhammad, U., Bilal, K., Khan, A., and Khan,<br />

M. N. Aghaz: An expert system based approach<br />

for the translation of english to urdu. International<br />

Journal of Social Sciences, 3(1):70–74, 2008.<br />

[2] Ahmed, T. The interaction of light verbs and verb<br />

classes of urdu. In Interdisciplinary workshop<br />

on Verbs: The i<strong>de</strong>ntification and representation of<br />

verb features, 2010.<br />

[3] Atish Durrani, M. Q. Z. Urdu informatics. Islamabad<br />

: Center of Excellence for Urdu Informatics,<br />

National Language Authority, 2008.<br />

[4] Hagan, M. and Menhaj, M. Training feedforward<br />

networks with the marquardt algorithm. Neural<br />

Networks, IEEE Transactions on, 5(6):989 –993,<br />

1994.<br />

[5] Hardie, A. Developing a tagset for automated<br />

part-of-speech tagging in urdu. In Corpus Linguistics<br />

2003, 2003.<br />

[6] Hock, H. Principles of historical linguistics.<br />

Mouton <strong>de</strong> Gruyter, 1986.<br />

[7] Hutchins, W. Machine Translation: past, present,<br />

future. Chichester : Ellis Horwood, 1986.<br />

[8] Imperial, N. K., Koncar, N., and Guthrie, D. G.<br />

A natural language translation neural network. In<br />

In Proceedings of the International Conference on<br />

New Methods in Language Processing (NeMLaP,<br />

pages 71–77, 1994.<br />

[9] Jain, A. N. Parsing complex sentences with structured<br />

connectionist networks. Neural Computation,<br />

3:110–120, 1991.<br />

[14] Naim, C. and Qaumi Kaunsil bara’e Taraqqi-yi<br />

Urdu (New Delhi, I. Introductory Urdu. Number<br />

v. 1. National Council for Promotion of Urdu<br />

Language, 2000.<br />

[15] Papineni, K., Papineni, K., Roukos, S., Roukos,<br />

S., Ward, T., Ward, T., jing Zhu, W., and jing Zhu,<br />

W. Bleu: A method for automatic evaluation of<br />

machine translation. pages 311–318, 2002.<br />

[16] Parser, S. Stanford parser,<br />

http://nlp.stanford.edu/software/lex-parser.shtml,<br />

2011.<br />

[17] SIL. Sil international, 2011.<br />

[18] Sinha, R. M. K. Developing english-urdu machine<br />

translation via hindi, 2009.<br />

[19] Tafseer Ahmed, S. A. English to urdu translation<br />

system, 2002.<br />

[20] Tagger, S. http://nlp.stanford.edu/software/tagger.shtml,<br />

2011.<br />

[21] Tahir, G., Asghar, S., and Masood, N. Knowledge<br />

based machine translation. In Information<br />

and Emerging Technologies (ICIET), 2010 International<br />

Conference on, pages 1 –5, 2010.<br />

[22] TDIL. Technology <strong>de</strong>velopment for indian languages<br />

programme, http://tdil-dc.in, 2011.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Shahnawaz and R. B. Mishra Translation Rules and ANN based mo<strong>de</strong>l for English to Urdu Machine Translation 47<br />

[23] Turian, J., Shen, L., and Melamed, I. D. Evaluation<br />

of machine translation and its evaluation. In<br />

In Proceedings of MT Summit IX, pages 386–393,<br />

2003.<br />

[24] Waibel, A., Jain, A., McNair, A., Saito, H., Hauptmann,<br />

A., and Tebelskis, J. Janus: a speechto-speech<br />

translation system using connectionist<br />

and symbolic processing strategies. In Acoustics,<br />

Speech, and Signal Processing, 1991. ICASSP-<br />

91., 1991 International Conference on, pages 793<br />

–796 vol.2, 1991.<br />

[25] Zafar, M. and Masood, A. Interactive english to<br />

urdu machine translation using example-based approach,<br />

2009.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 36-47, September of 2011.


Computing a Longest Common Subsequence of two strings when<br />

one of them is Run Length Enco<strong>de</strong>d<br />

SHEGUFTA BAKHT AHSAN 1<br />

TANAEEM M. MOOSA 2<br />

M. SOHEL RAHMAN 2<br />

SHAMPA SHAHRIYAR 1<br />

AlEDA Group, Department of CSE<br />

Bangla<strong>de</strong>sh University of Engineering and Technology<br />

1 (plaban777,shampa077)@gmail.com<br />

2 (tanaeem,msrahman)@cse.buet.ac.bd<br />

Abstract. Given two strings, the longest common subsequence (LCS) problem computes a common<br />

subsequence that has the maximum length. In this paper, we present new and efficient algorithms for<br />

solving the LCS problem for two strings one of which is run length enco<strong>de</strong>d (RLE). We first present<br />

an algorithm that runs in O(gN) time, where g is the length of the RLE string and N is the length of<br />

uncompressed string. Then based on the i<strong>de</strong>as of the above algorithm we present another algorithm that<br />

runs in O(R log(log g) + N) time, where R is the total number of or<strong>de</strong>red pairs of positions at which the<br />

two strings match. Our first algorithm matches the best algorithm in the literature for the same problem.<br />

On the other hand, for R < gN/ log(log)g, our second algorithm outperforms the best algorithms in the<br />

literature.<br />

Keywords: algorithms, longest common subsequence, run length enco<strong>de</strong>d strings.<br />

(Received May 15th, 2011 / Accepted September 1st, 2011)<br />

1 Introduction<br />

The longest common subsequence (LCS) problem is<br />

a classic and well-studied problem in computer science<br />

with extensive applications in diverse areas ranging<br />

from spelling error corrections to molecular biology.<br />

For example, the task of spelling error correction<br />

is to find the dictionary entry which resembles most a<br />

given word. In or<strong>de</strong>r to save storage a file archive of<br />

several versions of a source program is maintained compactly<br />

by storing only the original version and the differences<br />

of subsequent versions with the previous ones.<br />

In molecular biology [19, 1], we want to compare DNA<br />

or protein sequences to learn how homologous they are.<br />

All these cases can be seen as an investigation for the<br />

‘closeness’ among strings. And an obvious measure for<br />

the closeness of strings is to find the maximum number<br />

of common symbols in them preserving the or<strong>de</strong>r<br />

of the symbols. This is known as the longest common<br />

subsequence of two strings.<br />

Suppose we are given two strings<br />

X[1..N] = X[1]X[2] . . . X[N] and Y [1..G] =<br />

Y [1]Y [2] . . . Y [G]. Without the loss of generality,<br />

we can assume that N ≤ G. A subsequence<br />

S[1..R] = S[1]S[2] . . . S[R], 0 < R ≤ N of X is<br />

obtained by <strong>de</strong>leting N − R symbols from X. A<br />

common subsequence of two strings X and Y is a<br />

subsequence common to both X and Y . The longest<br />

common subsequence problem for two strings, is to<br />

find a common subsequence in both the strings, having<br />

the maximum possible length. We use lcs(X, Y ) and<br />

r(X, Y ) to <strong>de</strong>note a longest common subsequence of<br />

X and Y and its length, respectively.<br />

The classic dynamic programming solution to LCS<br />

problem, invented by Wagner and Fischer [22], has<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 48-55, September of 2011.


Shegufta Bakht Ahsan et al. Computing a Longest Common Subsequence of two strings when one of them is Run Length Enco<strong>de</strong>d 49<br />

O(NG) worst case running time. Masek and Paterson<br />

[15] improved this algorithm using the “Four-<br />

Russians" technique [4] to reduce the worst case running<br />

time to O(NG/ log N). Since then, not much<br />

improvement in terms of N, G can be found in the literature.<br />

However, several algorithms exist with complexities<br />

<strong>de</strong>pending on other parameters. For example,<br />

Myers in [17] and Nakatsu et al. in [18] presented<br />

an O(ND) algorithm, where the parameter D is<br />

the simple Levenshtein distance between the two given<br />

strings [13].<br />

Another interesting and perhaps more relevant parameter<br />

for this problem is R, which is the total number<br />

of or<strong>de</strong>red pairs of positions at which the two strings<br />

match. Hunt and Szymanski [8] presented an algorithm<br />

to solve the LCS problem in O((R + N) log N) time.<br />

They also cited applications, where R ∼ N and thereby<br />

claimed that for these applications the algorithm would<br />

run in O(N log N) time. Very recently, Iliopoulos and<br />

Rahman [10, 11] presented an efficient algorithm to<br />

solve the LCS problem in O(R log(log(N))+N) time.<br />

1.1 LCS for RLE Strings<br />

In this paper, we are interested to compute an LCS when<br />

one of the strings is run length enco<strong>de</strong>d. The motivation<br />

for using compressed strings as input comes from<br />

the huge size of biological sequences. Here we will<br />

be focusing on the run-length enco<strong>de</strong>d [12] strings. In<br />

a string, the maximal repeated string of characters is<br />

called a run and the number of repetitions is called the<br />

run-length. Thus, a string can be enco<strong>de</strong>d more compactly<br />

by replacing a run by a single instance of the repeated<br />

character along with its run-length. Compressing<br />

a string in this way is called run-length encoding<br />

and a run-length enco<strong>de</strong>d string is abbreviated as an<br />

RLE string.<br />

In what follows, we use the following convention:<br />

if X is a (uncompressed) string, then the run length encoding<br />

of X will be <strong>de</strong>noted by ˜X. For example, the<br />

RLE string of X = bdcccaaaaaa is ˜X = b 1 d 1 c 3 a 6 .<br />

Note that for ˜X, we <strong>de</strong>fine ˜X[1] = b 1 , ˜X[4] = a 6<br />

and so on. The notation |X| is used to <strong>de</strong>note its usual<br />

meaning, i.e., the length of X; the length of the corresponding<br />

RLE string ˜X is <strong>de</strong>noted by | ˜X|. We will<br />

use small letters to <strong>de</strong>note the length of an RLE string;<br />

whereas capital letters will be used to <strong>de</strong>note the length<br />

of an uncompressed string. For example, if |X| = N,<br />

then we shall use n to <strong>de</strong>note the length of ˜X.<br />

Note that, the notion of a match and hence the <strong>de</strong>finition<br />

of the set of matches, M, can be exten<strong>de</strong>d in a<br />

natural way when one or both of the strings involved<br />

is/are run length enco<strong>de</strong>d. For example, the notion of<br />

Figure 1: The set of matches M in two different settings. A dot in a<br />

cell indicates a match.<br />

a match (i, j) ∈ M, is exten<strong>de</strong>d when one input is an<br />

RLE string as follows: if Ỹ [i] = aq and X[j] = a then<br />

we say (i, j) ∈ M and run((i, j)) = q. The set M as<br />

well as its size in two different contexts are illustrated<br />

in Figure 1. In particular, Figure 1(a) consi<strong>de</strong>rs two<br />

normal strings and Figure 1.(b) illustrates the scenario<br />

when one of those is run length enco<strong>de</strong>d. The problem<br />

we handle in this paper is formally <strong>de</strong>fined as follows:<br />

Problem 1. Problem LCS_RLE. Given one uncompressed<br />

string X[1..N] = X[1]X[2] . . . X[N] and one<br />

RLE string Ỹ [1..g] = Ỹ [1]Ỹ [2] . . . Ỹ [g], we want to<br />

compute a Longest Common Subsequence (LCS) of X<br />

and Ỹ .<br />

We will use LCS_RLE(X, Ỹ ) to <strong>de</strong>note an LCS of<br />

X and Ỹ . There has been significant research on solving<br />

the LCS problem involving RLE strings in the literature.<br />

Mitchell proposed an algorithm [16] capable of<br />

computing an LCS when both the input are RLE strings.<br />

Given two RLE strings ˜X[1..n] and Ỹ [1..g], Mitchell’s<br />

algorithm runs in O((R + g + n) log(R + g + n))<br />

time. Apostolico et al. [3] gave another algorithm<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 48-55, September of 2011.


Shegufta Bakht Ahsan et al. Computing a Longest Common Subsequence of two strings when one of them is Run Length Enco<strong>de</strong>d 50<br />

for solving the same problem in O(gn log(gn)) time<br />

whereas the algorithm of Freschi and Bogliolo [6] runs<br />

in O(gN + Gn − gn) time. Ann et al. also proposed<br />

an algorithm to compute an LCS of two run length enco<strong>de</strong>d<br />

strings [2] in O(gn + min{g 1 , g 2 }) where g 1 , g 2<br />

<strong>de</strong>note the number of elements in the bottom and right<br />

boun<strong>da</strong>ries of the matched blocks respectively. The version<br />

of the problem where only one string is run length<br />

enco<strong>de</strong>d was handled recently by Liua et al. in [14].<br />

Here, the authors proposed an O(gN) time algorithm<br />

to solve the problem.<br />

when we talk about comparing two RLE genomes, we<br />

often ignore the cost of compressing the two genomes.<br />

Now, if we count the cost of compression, then our<br />

algorithms (and the algorithm of Liua et al. in [14])<br />

may turn out to be more favourable in different practical<br />

settings. Finally, our work can be seen as a building<br />

block for an efficient algorithm for the version where<br />

both strings are RLE. In<strong>de</strong>ed, we believe that combining<br />

some of the tricks of Mitchell [16] with our work,<br />

we would be able to get an algorithm for two RLE<br />

strings that runs faster than Mitchell’s algorithm.<br />

1.2 Our Contribution<br />

In this paper, we make an effort to solve the LCS<br />

problem efficiently when one of the input strings is<br />

run length enco<strong>de</strong>d. Our main contributions are two<br />

novel efficient algorithms, namely, LCS_RLE-I and<br />

LCS_RLE-II, to solve Problem 1. In particular, we<br />

first present a novel and interesting i<strong>de</strong>a to solve the<br />

problem and present an algorithm that runs in O(gN)<br />

time (LCS_RLE-I). This matches the best algorithm in<br />

the literature [14] for the same problem. Subsequently,<br />

based on the i<strong>de</strong>as of our above algorithm, we present<br />

another algorithm that runs in O(R log(log(g)) + N)<br />

time (LCS_RLE-II). Clearly, for R < gN/ log(log(g)),<br />

our second algorithm outperforms the best algorithms<br />

in the literature. In this context, Algorithm LCS_RLE-<br />

II is an input sensitive algorithm. In many cases, the<br />

input could be such that R = o(gN). In such cases,<br />

our algorithm will <strong>de</strong>finitely show better behaviour<br />

than the other algorithms. Also, note that, in our setting,<br />

Mitchell’s algorithm would run in O((R + G +<br />

n) log(R + G + n)) time, which clearly is worse than<br />

ours. (Notably, Mitchell’s algorithm could also be used<br />

in our setting with an extra preprocessing step to compress<br />

the uncompressed string. In this case, the cost of<br />

compression must be taken into account.)<br />

With the existence of LCS algorithms in the literature<br />

that can <strong>de</strong>al with both RLE strings, our algorithms<br />

may seem to be only theoretically interesting. However,<br />

we note the following points in favour of the practical<br />

importance of our algorithms. Firstly, in many practical<br />

instances a much smaller reference pattern is compared<br />

with a large genome. In such cases our version of the<br />

problem may turn out to be more relevant. Secondly,<br />

1.3 Roadmap<br />

The rest of the paper is organized as follows. In<br />

Section 2, we present an O(gN) algorithm, namely<br />

LCS_RLE-I, to solve Problem LCS_RLE. LCS_RLE-I<br />

provi<strong>de</strong>s the base of our second algorithm, LCS_RLE-<br />

II, <strong>de</strong>scribed in Section 3. We achieve O(R log log g +<br />

N) running time for LCS_RLE-II. Finally, we briefly<br />

conclu<strong>de</strong> in Section 4.<br />

2 A New Algorithm<br />

In this section, we present Algorithm LCS_RLE-I<br />

which works in O(gN) time. Since our algorithm <strong>de</strong>pends<br />

on some i<strong>de</strong>as of Algorithm LCS-I of [10, 11],<br />

we give a very brief overview of LCS-I in the following<br />

subsection.<br />

2.1 Review of LCS-I<br />

Note that, LCS-I solves the classic LCS problem for<br />

two given strings X and Y . For the ease of exposition,<br />

and to remain in line with the <strong>de</strong>scription of [10, 11],<br />

while reviewing LCS-I (in this section) we will assume<br />

that |X| = |Y | = N. Recall that, we say a pair<br />

(i, j), 1 ≤ i ≤ N, 1 ≤ j ≤ G, <strong>de</strong>fines a match, if<br />

X[i] = Y [j]. The set of all matches, M, is <strong>de</strong>fined as<br />

follows:<br />

M = {(i, j) | X[i] = Y [j], 1 ≤ i ≤ N, 1 ≤ j ≤ G}.<br />

Observe that |M| = R. From the <strong>de</strong>finition of LCS<br />

it is clear that if (i, j) ∈ M, then we can calculate<br />

T [i, j], 1 ≤ i, j ≤ N by employing the Equation 1<br />

from [20, 9].<br />

⎧<br />

Un<strong>de</strong>fined if (i, j) /∈ M,<br />

⎪⎨<br />

1 if (i = 1 or j = 1) and (i, j) ∈ M<br />

T [i, j] =<br />

max 1≤li


Shegufta Bakht Ahsan et al. Computing a Longest Common Subsequence of two strings when one of them is Run Length Enco<strong>de</strong>d 51<br />

Here we have used the tabular notion T [i, j] to <strong>de</strong>note<br />

r(Y [1..i], X[1..j]). We use the notation M i to <strong>de</strong>note<br />

the set of matches in Row i. Also, for the sake<br />

of better exposition we impose a numbering on the<br />

matches of a particular row from left to right as follows.<br />

If we have M i = {(i, j 1 ), (i, j 2 ), . . . , (i, j l )},<br />

such that 1 ≤ j 1 < j 2 < . . . < j l , then, we say that<br />

number((i, j q )) = q and may refer to the match (i, j q )<br />

as the qth match in Row i. Note that, number((i, j q ))<br />

may or may not be equal to j q .<br />

In what follows, we assume that we are given the set<br />

M in the prescribed or<strong>de</strong>r assuming a row by row operation.<br />

LCS-I <strong>de</strong>pends on the following facts, problem<br />

and results.<br />

Fact 1. ([9, 20]) Suppose (i, j) ∈ M. Then for all<br />

(i ′ , j) ∈ M, i ′ > i, (resp. (i, j ′ ) ∈ M, j ′ > j),<br />

we must have T [i ′ , j] ≥ T [i, j] (resp. T [i, j ′ ] ≥<br />

T [i, j]). □<br />

Fact 2. ([9, 20]) The calculation of the entry<br />

T [i, j], (i, j) ∈ M, 1 ≤ i, j ≤ n, is in<strong>de</strong>pen<strong>de</strong>nt of<br />

any T [l, q], (l, q) ∈ M, l = i, 1 ≤ q ≤ N. □<br />

Problem 2. Range Maxima Query Problem. We are<br />

given an array A = a 1 a 2 ...a n of numbers. We need to<br />

preprocess A to answer the following form of queries:<br />

Query: Given an interval I = [i s ..i e ], 1 ≤ i s ≤ i e ≤<br />

n, the goal is to find the in<strong>de</strong>x k (or the value A[k] itself)<br />

with maximum value (ties can be broken arbitrarily, e.g.<br />

by taking the one with larger (smaller) in<strong>de</strong>x) A[k] for<br />

k ∈ I. The query is <strong>de</strong>noted by RMQ A (i s , i e )<br />

Theorem 1. ( [7, 5]) Range Maxima Query Problem<br />

can be solved in O(n) preprocessing time and O(1)<br />

time per query. □<br />

Now, assume that we are computing the match<br />

(i, j). LCS-I maintains an array H of length N, where,<br />

for the current value of i ∈ [1..N] we have, H[l] =<br />

max 1≤k 1, then, we require two steps. Firstly, we<br />

perform the baseOperation. Then, in the second step<br />

(referred to as the weightOperation), we consi<strong>de</strong>r q<br />

previous matches (if fewer matches are available we<br />

need to consi<strong>de</strong>r all of them) in Row i, including the<br />

current one. Now, note carefully that T -values for these<br />

matches have already been computed and reflected in<br />

the S array. We copy S to K and S array is never<br />

changed by any weightOperation. For Row i, we call<br />

K[k] to be a match position if (i, k) ∈ M i and K[k]<br />

and k are referred to as the corresponding K-value and<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 48-55, September of 2011.


Shegufta Bakht Ahsan et al. Computing a Longest Common Subsequence of two strings when one of them is Run Length Enco<strong>de</strong>d 52<br />

K-in<strong>de</strong>x (similar notations are also <strong>de</strong>fined for the arrays<br />

H and S). Now, we add a weight to each of the<br />

corresponding K-values: the weight is 0 for the current<br />

match, 1 for the previous match, 2 for the match before<br />

it and so on. Now observe that T [i, j] will be the maximum<br />

of these values. This is because the kth element<br />

of this “window" from right, corresponds to matching k<br />

a’s from the run a q with rightmost k a’s from X ′ and<br />

then matching the remaining substring with Ỹ ′ .<br />

We will use an array K to do this computation efficiently.<br />

Now recall that we are handling the match<br />

(i, j) ∈ M i . We can implement the weightOperation<br />

by adding the appropriate weights at the corresponding<br />

match positions of K and then performing the query<br />

RMQ K (u, j), such that K[u] is a match position (due<br />

to (i, u)) and q = number((i, j)) − number((i, u)) +<br />

1. In what follows we will refer to the above range<br />

(i.e., the range [u..j]) as the weighted query window.<br />

However, in this strategy, we may need to adjust the<br />

weights every time we compute a new match since for<br />

each match the weighted query window may change.<br />

However, this would be costly. In what follows, we discuss<br />

how to do this more efficiently.<br />

Rather than adding the appropriate weight, for a<br />

particular row, we will add relative weight to all the<br />

match positions of K. This would ensure that the<br />

position of the maximum value remains the same, although<br />

the value may not. To get the correct value, we<br />

will finally <strong>de</strong>duct the appropriate difference from the<br />

value. We do it as follows. After the baseOperation,<br />

we copy the array S to array K. Then, to a match<br />

(i, l), 1 ≤ l ≤ |M i | we add |M i |−number((i, j))+1<br />

as the relative weight. In other words we give weight<br />

1 to the rightmost match, 2 to the next one and so on<br />

and finally, |M i | to the first match.<br />

Now recall that we are consi<strong>de</strong>ring the match<br />

(i, j) ∈ M i , i.e., we are computing T [i, j]. Assume<br />

that number((i, j)) = |M i | − k + 1, i.e.,<br />

this is the kth match position from right. As before,<br />

we execute the query RMQ K (q, j), such that<br />

K[u] is a match position (due to (i, u)) and q =<br />

number((i, j)) − number((i, u)) + 1. However, this<br />

time we need to do some adjustment as follows. It is<br />

easy to realize that each of the values of the matched<br />

positions in K[u..j], is k higher than the actual value.<br />

So, to correct the computation we perform T [i, j] =<br />

RMQ K (q, j) − k.<br />

The analysis of the algorithm is similar to that of<br />

LCS-I algorithm of [10, 11]. As we need to do at<br />

most two RMQ preprocessing per row, overall it will<br />

cost O(Ng) time (using O(N) time preprocessing algorithm).<br />

We need two RMQ queries per match which<br />

amounts to O(R) (using constant time RMQ query)<br />

time. Note that, in the worst case R = O(Ng). Finally,<br />

it is easy to see that, the set M in the prescribed or<strong>de</strong>r<br />

can be computed easily in O(Ng) time. Therefore, we<br />

get the following theorem.<br />

Theorem 2. LCS_RLE-I solves Problem LCS_RLE in<br />

O(Ng) time. □<br />

2.3 An Illustrative Example<br />

In this section, we will give a partial example on<br />

how the LCS_RLE-I algorithm works for X =<br />

ABBCCCAAAA and Ỹ = C3 A 3 . We assume that<br />

we have already completed processing the matches belonging<br />

to Row 1 (i.e. M 1 ). After calculating Row 1,<br />

values of S array are shown in Table 1 and the T -values<br />

of Row 1 are shown in Table 2<br />

value 0 0 0 0 1 2 3 0 0 0 0<br />

in<strong>de</strong>x 0 1 2 3 4 5 6 7 8 9 10<br />

Table 1: S array after calculating Row 1<br />

C 3 0 0 0 0 1 2 3 0 0 0 0<br />

A B B C C C A A A A<br />

in<strong>de</strong>x 0 1 2 3 4 5 6 7 8 9 10<br />

Table 2: T -values of Row 1 after processing all the matches of Row<br />

1<br />

Now we will calculate Row 2. We have, M 2 =<br />

{(2, 1), (2, 7), (2, 8), (2, 9), (2, 10)}. Here, we have to<br />

perform both baseOperation and weightOperation.<br />

The values of S array After baseOperations for all the<br />

matches of M 2 are shown in Table 3<br />

value 0 1 0 0 1 2 3 4 4 4 4<br />

in<strong>de</strong>x 0 1 2 3 4 5 6 7 8 9 10<br />

Table 3: S array after baseOperations of all the matches of Row 2<br />

To calculate weightOperation, we will copy the S<br />

array into the K array and add relative weight as shown<br />

in Table 4 and Table 5.<br />

value 0 1 0 0 1 2 3 4 4 4 4<br />

weight 0 5 0 0 0 0 0 4 3 2 1<br />

in<strong>de</strong>x 0 1 2 3 4 5 6 7 8 9 10<br />

Table 4: K-Array before addition of relative weight<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 48-55, September of 2011.


Shegufta Bakht Ahsan et al. Computing a Longest Common Subsequence of two strings when one of them is Run Length Enco<strong>de</strong>d 53<br />

value 0 6 0 0 1 2 3 8 7 6 5 follows. We will use the vEB tree for this purpose.<br />

in<strong>de</strong>x 0 1 2 3 4 5 6 7 8 9 10<br />

Recall that we want to find the maximum value of<br />

Table 5: K-Array after addition of relative weight K in the weighted query window. Furthermore,<br />

note that, only the matched positions of K in the<br />

weighted query window are important in the calculation.<br />

So instead of maintaining the array K, we maintain<br />

a vEB tree where always the appropriate num-<br />

After calculating the matches of Row 2, values of S<br />

Array and T Array are shown in Table 6 and Table 7 ber (q in this case) of matches (with values after the<br />

respectively.<br />

addition of the relative weights) are kept. And as<br />

value 0 1 0 0 1 2 3 4 5 6 6<br />

in<strong>de</strong>x 0 1 2 3 4 5 6 7 8 9 10<br />

Table 6: S array after calculating Row 2<br />

A 3 0 1 0 0 0 0 0 4 5 6 6<br />

C 3 0 0 0 0 1 2 3 0 0 0 0<br />

A B B C C C A A A A<br />

in<strong>de</strong>x 0 1 2 3 4 5 6 7 8 9 10<br />

Table 7: T -values of Row 2 after processing all the matches of Row<br />

2<br />

3 LCS_RLE-II<br />

In this section, we use the i<strong>de</strong>as of LCS_RLE-I to<br />

present our second algorithm, LCS_RLE-II, which runs<br />

in O(R log(log(g)) + N) time. To achieve this running<br />

time, we will use an elegant <strong>da</strong>ta structure (referred<br />

to as the vEB tree henceforth) invented by van Em<strong>de</strong><br />

Boas [21] that allows us to maintain a sorted list of integers<br />

in the range [1..n] in O(log(log(n))) time per<br />

insertion and <strong>de</strong>letion. In addition to that it can return<br />

next(i) (successor element of i in the list) and prev(i)<br />

(pre<strong>de</strong>cessor element of i in the list) in constant time.<br />

We follow the same terminology and assume the<br />

same settings of Section 2 to <strong>de</strong>scribe LCS_RLE-<br />

II. So, assume that we are consi<strong>de</strong>ring the match<br />

(i, j) ∈ M i and recall that when the the computation<br />

of the match (i, j) would be complete, i.e. T [i, j]<br />

is completely computed, we would have the result<br />

of LCS_RLE(Ỹ ′ a p , X ′ ). Note carefully that the<br />

baseOperation is basically the operation required to<br />

compute a normal LCS. We can use the LCS algorithm<br />

of [10] or [11] just to do the baseOperation<br />

for each match. Then, for each match we would<br />

only need O(log(log(g))) time [11, 10], requiring<br />

a total of O(R log(log(g))) time to perform all the<br />

baseOperations.<br />

Now, we focus on the weightOperations. Our<br />

goal is to completely avoid any RMQ preprocessing.<br />

We need to modify the weightOperation as<br />

the computation moves from one match to the next,<br />

to maintain the appropriate weighted query window,<br />

only one element (corresponding to a match) is ad<strong>de</strong>d<br />

to the vEB tree and at most one element is <strong>de</strong>leted.<br />

(We do not need to <strong>de</strong>lete any element if the current<br />

weighted query window has fewer matches than q.)<br />

When we need the maximum value of the<br />

weighted query window, we just find the maximum<br />

from the vEB tree which can also be found in<br />

O(log(log(g))) time (by inserting a fictitious element<br />

having infinite value and then <strong>de</strong>leting it after computing<br />

its pre<strong>de</strong>cessor). As we need to insert and <strong>de</strong>lete<br />

constant number of elements from the vEB tree for each<br />

match, this can be done in O(R log(log(g))) time on<br />

the whole. Like before, we would need to <strong>de</strong>duct the<br />

appropriate value ((|M i | + 1 − number((i, j)) in this<br />

case) from the returned maximum to do the proper adjustment.<br />

Algorithm 1 presents the i<strong>de</strong>a (only the computation<br />

of the values) more formally. Notably, we must<br />

maintain appropriate pointers to recover the actual LCS<br />

after the computation is done.<br />

Finally, the computation of the set M in the prescribed<br />

or<strong>de</strong>r can be done following the preprocessing<br />

algorithm of [10, 11] which runs in O(R log(log(g)) +<br />

N) time. So, we have the following theorem.<br />

Theorem 3. LCS_RLE-II solves Problem LCS_RLE in<br />

O(R log(log(g)) + N) time.<br />

4 Conclusion<br />

In this paper, we have studied the longest common subsequence<br />

problem for two strings, where one of the<br />

input strings is run length enco<strong>de</strong>d. We have presented<br />

two novel algorithms, namely LCS_RLE-I and<br />

LCS_RLE-II to solve the problem. We have first presented<br />

LCS_RLE-I combining some new i<strong>de</strong>as with the<br />

techniques used in [11, 10]. LCS_RLE-I runs in O(gN)<br />

time, which matches the best algorithm in the literature.<br />

Then we present an input sensitive algorithm, namely,<br />

LCS_RLE-II that runs in O(R log(log(g)) + N) time.<br />

Observe that in the worst case, R = O(gN) and hence<br />

the worst case running time of LCS_RLE-II is slightly<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 48-55, September of 2011.


Shegufta Bakht Ahsan et al. Computing a Longest Common Subsequence of two strings when one of them is Run Length Enco<strong>de</strong>d 54<br />

Algorithm 1 LCS_RLE-II: Computation of Row i<br />

(Only the computation of value is shown)<br />

1: for each (i, j) ∈ M i in the left to right or<strong>de</strong>r do<br />

2: Perform baseOperation and up<strong>da</strong>te S array accordingly<br />

3: end for<br />

{Now we perform the weightOperation for every<br />

match of M i . Assume that each vEB element is a<br />

tuple (value, pos)}<br />

4: vEBTree = null<br />

5: for each (i, j) ∈ M i in the left to right or<strong>de</strong>r do<br />

6: relativeW eight = |M i | − number((i, j)) + 1<br />

7: vebTree.Insert((S[j]+relativeWeight,j))<br />

8: if |vebT ree| > q then<br />

9: Delete the earliest inserted element from veb-<br />

Tree {The earliest inserted element can be efficiently<br />

found by maintaining a normal linked<br />

list between the inserted elements}<br />

10: end if<br />

11: S[j] = vebT ree.Maximum() − (|M i | + 1 −<br />

number((i, j)))<br />

12: T [i, j] = S[j]<br />

13: end for<br />

Acknowledments<br />

The authors would like to thank the annonymous reviewers<br />

and the editor for constructive comments and<br />

suggestions which improved the presentation of the paper<br />

a lot. This research work constitues part of the B.Sc.<br />

Engineering thesis of Ahsan and Shahriyar un<strong>de</strong>r the<br />

supervision of Rahman. Moosa is currently working at<br />

Google Inc., USA.<br />

References<br />

[1] Altschul, S. F., Gish, W., Miller, W., Meyers,<br />

E. W., and Lipman, D. J. Basic local alignment<br />

search tool. Journal of Molecular Biology,<br />

215(3):403–410, 1990.<br />

[2] Ann, H.-Y., Yang, C.-B., Tseng, C.-T., and Hor,<br />

C.-Y. A fast and simple algorithm for computing<br />

the longest common subsequence of run-length<br />

enco<strong>de</strong>d strings. Inf. Process. Lett., 108(6):360–<br />

364, 2008.<br />

[3] Apostolico, A., Lan<strong>da</strong>u, G. M., and Skiena, S.<br />

Matching for run-length enco<strong>de</strong>d strings. J. Complexity,<br />

15(1):4–16, 1999.<br />

worse than the best algorithm in the literature. However,<br />

in many cases R = o(gN), and our algorithm<br />

would show superior behaviour in these cases. In particular,<br />

if R < gN/ log(log(g)), LCS_RLE-II will outperform<br />

the best algorithms in the literature. Additionally,<br />

if we run Mitchell’s algorithm (the best algorithm<br />

in the literature for two RLE strings) in our setting, the<br />

running time would be O((R+G+n) log(R+G+n)),<br />

which clearly is worse than ours. Also, employing some<br />

of the insights of Mitchel [16], we believe, our work can<br />

be exten<strong>de</strong>d to the version where both the input are RLE<br />

strings.<br />

Finally, all the works in the literature so far on<br />

LCS computation consi<strong>de</strong>ring RLE strings focused<br />

only on theoretical complexity results of the <strong>de</strong>vised algorithms.<br />

Theoretical improvement in these algorithms<br />

were achieved in most cases by using complex <strong>da</strong>ta<br />

structures (e.g., in our case, vEB tree and RMQ <strong>da</strong>ta<br />

structures). In practice, such algorithms, <strong>de</strong>spite having<br />

better theoretical bounds, may turn out to be worse in<br />

performance. Hence, an interesting research direction<br />

could be to implement the algorithms in the literature<br />

along the new ones proposed here and to compare them<br />

against each other from a practical point of view. Notably,<br />

we have already started working in this direction<br />

and hope to present the findings in a forthcoming paper.<br />

[4] Arlazarov, V., Dinic, E., Kronrod, M., and<br />

Faradzev, I. On economic construction of the transitive<br />

closure of a directed graph (english translation).<br />

Soviet Math. Dokl., 11:1209–1210, 1975.<br />

[5] Ben<strong>de</strong>r, M. A. and Farach-Colton, M. The lca<br />

problem revisited. In LATIN, pages 88–94, 2000.<br />

[6] Freschi, V. and Bogliolo, A. Longest common<br />

subsequence between run-length-enco<strong>de</strong>d strings:<br />

a new algorithm with improved parallelism. Inf.<br />

Process. Lett., 90(4):167–173, 2004.<br />

[7] Gabow, H., Bentley, J., and Tarjan, R. Scaling<br />

and related techniques for geometry problems. In<br />

STOC, pages 135–143, 1984.<br />

[8] Hunt, J. W. and Szymanski, T. G. A fast algorithm<br />

for computing longest subsequences. Commun.<br />

ACM, 20(5):350–353, 1977.<br />

[9] Iliopoulos, C. S. and Rahman, M. S. Algorithms<br />

for computing variants of the longest common<br />

subsequence problem. Theor. Comput. Sci.,<br />

395(2-3):255–267, 2008.<br />

[10] Iliopoulos, C. S. and Rahman, M. S. New efficient<br />

algorithms for the lcs and constrained lcs<br />

problems. Inf. Process. Lett., 106(1):13–18, 2008.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 48-55, September of 2011.


Shegufta Bakht Ahsan et al. Computing a Longest Common Subsequence of two strings when one of them is Run Length Enco<strong>de</strong>d 55<br />

[11] Iliopoulos, C. S. and Rahman, M. S. A new<br />

efficient algorithm for computing the longest<br />

common subsequence. Theory Comput. Syst.,<br />

45(2):355–371, 2009.<br />

[12] K. Sayoood, E. F. E. Introduction to Data Compression.<br />

Morgan Kaufmann Publishers Inc, 2000.<br />

[13] Levenshtein, V. Binary co<strong>de</strong>s capable of correcting<br />

<strong>de</strong>letions, insertions, and reversals. Problems<br />

in Information Transmission, 1:8–17, 1965.<br />

[14] Liu, J. J., Wang, Y.-L., and Lee, R. C. T. Finding<br />

a longest common subsequence between a<br />

run-length-enco<strong>de</strong>d string and an uncompressed<br />

string. J. Complexity, 24(2):173–184, 2008.<br />

[15] Masek, W. J. and Paterson, M. A faster algorithm<br />

computing string edit distances. J. Comput. Syst.<br />

Sci., 20(1):18–31, 1980.<br />

[16] Mitchell, J. A geometric shortest path problem,<br />

with application to computing a longest common<br />

subsequence in run-length enco<strong>de</strong>d strings. Technical<br />

Report Department of Applied Mathematics,<br />

SUNY Stony Brook, 1997.<br />

[17] Myers, E. W. An o(nd) difference algorithm and<br />

its variations. Algorithmica, 1(2):251–266, 1986.<br />

[18] Nakatsu, N., Kambayashi, Y., and Yajima, S. A<br />

longest common subsequence algorithm suitable<br />

for similar text strings. Acta Inf., 18:171–179,<br />

1982.<br />

[19] Pearson, W. and Lipman, D. Improved tools<br />

for biological sequence comparison. Proceedings<br />

of National Aca<strong>de</strong>my of Science, USA, 85:2444–<br />

2448, 1988.<br />

[20] Rahman, M. S. and Iliopoulos, C. S. Algorithms<br />

for computing variants of the longest common<br />

subsequence problem. In ISAAC, pages 399–408,<br />

2006.<br />

[21] van Em<strong>de</strong> Boas, P. Preserving or<strong>de</strong>r in a forest in<br />

less than logarithmic time and linear space. Information<br />

Processing Letters, 6:80–82, 1977.<br />

[22] Wagner, R. A. and Fischer, M. J. The string-tostring<br />

correction problem. J. ACM, 21(1):168–<br />

173, 1974.<br />

<strong>INFOCOMP</strong>, v. 10, no. 3, p. 48-55, September of 2011.


Universi<strong>da</strong><strong>de</strong> Fe<strong>de</strong>ral <strong>de</strong> Lavras<br />

<strong>INFOCOMP</strong> Journal of Computer Science<br />

Publication gui<strong>de</strong>lines (July of 2011)<br />

1. <strong>INFOCOMP</strong> publishes original scientific and technological papers in English. The<br />

papers should be related to Computer Science.<br />

2. The papers should be submitted in PDF format without authors’ informations using<br />

the JEMS system (https://submissoes.sbc.org.br/infocomp) of the Brazilian Computer<br />

Society (SBC). Login and password are necessary and they can be obtained<br />

online in the JEMS system.<br />

3. The papers should follow the <strong>INFOCOMP</strong> format: Paper Letter (21.5x28.0cm), 1.1<br />

line spacing, Times New Roman 10, justified text, with superior, inferior, left and<br />

right margins of 2.5 cm. The number of pages should not exceed 12. Papers with<br />

more than 12 pages may be accepted after analysis by the editorial board.<br />

4. The first page should contain title, authors (only in the final version), abstract and<br />

keywords. Afterwards, it should contain the following text centralized: “(Received<br />

January 1st, 2005 / Accepted December 31st, 2005)” for posterior edition with the<br />

correct <strong>da</strong>tes. These informations should not exceed one page and should be in one<br />

column. The title should be in font size 14.<br />

5. The authors’ names (only in the final and accepted version) should be si<strong>de</strong>d horizontally,<br />

i<strong>de</strong>ntified by a superscripted number. The affiliation and the electronic<br />

address of each author should be written right below the names.<br />

6. The text of the paper should be formatted in two columns, separated by 0.5cm,<br />

with numerated sections and subsections. Examples are: 1. Introduction, 1.1.<br />

Terminology. Figures and tables may occupy the page width, if necessary. The<br />

figure and table titles should be numerated and centralized below them.<br />

7. The references should be numerated and listed in alphabetical or<strong>de</strong>r. Ex: [5]<br />

Hougardy, S. Even pairs and the strong perfect graph conjecture, Discrete Math.<br />

v.154, p.277-288, 1996. Citations should be ma<strong>de</strong> based on the number of the reference.<br />

“In [5], it was proved that...” is an example of citation.<br />

8. Footnotes may be accepted, when strongly necessary, for explanations that cannot<br />

be inclu<strong>de</strong>d in the text, such as: (a) name of the research institution; (b) support<br />

organizations and other financial supports; (c) reference to the publication as part<br />

of MSc or PhD thesis; (d) personal communication.<br />

9. The authors give the right of publishing and formatting the articles upon submission.<br />

10. Non compliance with these rules will result in the non acceptance of the paper.<br />

11. Publications in the <strong>INFOCOMP</strong> are free of charge.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!