kept 2015 knowledge engineering principles and · pdf filekept 2015: knowledge engineering:...

95
Babes ¸-Bolyai University KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND TECHNIQUES BOOK OF ABSTRACTS EDITORS: Militon FRENT ¸ IU Horia F. POP Simona MOTOGNA Cluj-Napoca, July 2, 2015

Upload: ledien

Post on 31-Jan-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

Babes-Bolyai University

KEPT 2015

KNOWLEDGE ENGINEERING

PRINCIPLES

AND

TECHNIQUES

BOOK OF ABSTRACTS

EDITORS:

Militon FRENTIU Horia F. POPSimona MOTOGNA

Cluj-Napoca, July 2, 2015

Page 2: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis
Page 3: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

CONTENTS

Software Engineering

Arthur-Jozsef Molnar, Using Static Analysis in Coverage Criteria for

GUI Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

Tibor Kiss, Formal Verification of LARIS programs using Session Types

and First Order Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Gabriel Ciobanu, Dan Cojocar, Domain Mobile Ambients for

Network Routing Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13

Annamria Szenkovits, Environment model-based testing of reactive

systems: a case study on a SCADE model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Zoltan Toser, Richard Bellon, David Hornyak, Zoltan

Horvath, Tamas Kozsik, Robert A. Rill, Andras Lorincz,

Functional Programming Framework for Cyber-Physical Systems . . . . . . . . . 21

Simona Motogna, Camelia Serban, Andreea Vescan, Metric-

Based Refactoring Strategy and Impact on Software Quality . . . . . . . . . . . . . . 25

Virginia Niculescu, Comparing C# and Java Extension Methods in

the Context of Implementing MixDecorator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Alexandru Moraru, Adrian Sterca, Rares Boian, Parallel

Tracking and Mapping with Surface Detection for Augmented Reality . . . . 33

Artificial Intelligence

Ioan-Mircea Gabriel,Gabriela Czibula, Mara-Renata Petrusel,

Decision Ttree Based Gender Identification in Human Rremains . . . . . . . . . . 39

Robert-Adrian Rill, Zoltan Toser, Andras Lorincz, Facial

Landmark Based Gaze Direction Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Vlad-Sebastian Ionescu, Archaeological Height Prediction Using

Support Vector Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471

Page 4: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

Ildiko Szabo, Alina Pana, Facial Emotion Detection System Using

Microsoft Kinect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Zsuzsanna Marian, Istvan Gergely Czibula, Gabriela Czibula,

Sergiu Sotoc, Self-Organizing Maps for Identifying Software Defects . . . .55

Alina-Delia Calin, A Comparative Study of Artificial Intelligence

Methods for Kinect Gesture Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59

Danut Ovidiu Pop, Hypervigilance Driver Detection . . . . . . . . . . . . . . . . . . . 63

Flavia Micota, Roxana Dogaru, Daniela Zaharie, Semantic

Similarity Measures for Lists of Taxonomic Codes . . . . . . . . . . . . . . . . . . . . . . . . 67

Adriana M. Coroiu, Radu D. Gaceanu, Horia F. Pop, Ordinal

Data Analysis Using Agglomerative Clustering Algorithms . . . . . . . . . . . . . . . .71

Camelia Lemnaru, Rodica Potolea, Feature Selection for

Imbalanced Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75

Valeriu Anisiu, Integer Programming via Groebner Bases – Maxima

Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

Radu D. Gaceanu, Arnold Szederjesi, An Agglomerative Clustering

Approach using Software Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

Andreea Diana Mihis, Mihaela Lupea, Moisil Boolean Functions

Simplification Method Used for Summary Extraction from Text . . . . . . . . . . 86

Amalia Goia, Adrian Sterca, Rares Boian, Categorizing Aesthetic

Photos from Large Photography Collections using SVM . . . . . . . . . . . . . . . . . . 87

Diana Lucia Miholca, Artificial Neural Networks Applied in

Archaeology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91

Vlad Sebastian Ionescu, Applied Computational Intelligence

Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

Attila Zolde, An Applied Optimal Packing Algorithm with

Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

2

Page 5: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

SOFTWARE ENGINNERING

Page 6: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis
Page 7: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 5–8

USING STATIC ANALYSIS IN COVERAGE CRITERIA FOR

GUI APPLICATIONS

ARTHUR-JOZSEF MOLNAR

Abstract. The present paper introduces new metrics for measuring thecoverage of GUI application test cases. Our goal is to leverage establishedmetrics and adapt them to the peculiarities of GUI applications, wherecoverage can be more naturally described in terms of events rather thanattributes such as classes or methods. We describe how static analysis canbe used to calculate coverage information for GUI test cases and we presentour initial work on software tools that support automating the process.

1. Introduction

Software applications using graphical user interfaces (GUI) represent to-day’s pervasive paradigm for human-computer interaction and we expect themto remain so for the foreseeable future. As such, it stands to reason thatmethodologies and tools that support development and maintenance of GUIapplications must keep pace, especially when considering that in many casesGUI code takes up as much as 50% of application code [9]. However, GUIdriven applications require new approaches with regards to design, imple-mentation and testing. The issue we aim to address in this paper regardsintroducing coverage criteria relevant for GUI test cases.

Established criteria that are widely used in both testing literature as wellas industry are code-coverage related and include statement, class and branchcoverages. By achieving the desired coverage threshold, stakeholders gainknowledge regarding the robustness of the application under test. In order tofurther study test case effectiveness, fault injection and mutation testing canbe employed [6] to deliberately change program code with the aim of inducingsoftware errors. The test suite is then assessed by how well it detects these

Received by the editors: 15.04.2015.2010 Mathematics Subject Classification. 68N01.1998 CR Categories and Descriptors. D.2.5 [Testing and Debugging]: Subtopic –

Testing tools (e.g., data generators, coverage testing).Key words and phrases. GUI, application, code, coverage, event.

c©2015 Babes-Bolyai University, Cluj-Napoca

5

Page 8: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

6 ARTHUR-JOZSEF MOLNAR

”mutants”. While useful in the context of GUI testing [1], these techniquespresent significant challenges such as equivalent mutants, selection of suitablemutation operators and being computationally intensive.

While these methodologies were adapted to GUI application testing, froma system testing perspective we find GUI applications to be better defined interms of events rather than associated code. As such, our research is focusedon also leveraging event information in order to devise coverage criteria for sys-tems under test. Our work builds on the introduction of event-based criteriafor test case quality measurement, including ”event coverage”, ”event inter-action coverage” and its generalization ”length-n event-sequence coverage”,described in [5]. These criteria require that all events in a GUI component befired, all valid event-pairs to be fired and all n-tuples of valid event sequencesbe fired during the testing process, respectively. In order to illustrate therelation between event-based and the more established code-based coveragecriteria, [5] provides a case study illustrating how achieving sequence-n lengthcoverage with n = 2, 31 also leads to high code coverage [5].

The rest of this paper is structured as follows: in the next section we definenew coverage metrics for GUI test cases and we dedicate the last section todetailing our ongoing work on tool support.

2. Coverage metrics based on static analysis

Our proposed approach combines established code coverage criteria withMemon’s event-sequence coverage as defined in [5]. To this we add knowledgegained from call graphs built using static analysis to enable gaining an im-proved picture of GUI application code coverage. The first step is to define aGUI event’s call graph.

Definition. Event call graph. Given a GUI event e, we define its eventcall graph as a subgraph of the application’s statically computed call graphthat consists of event e’s application-level event handlers and all applicationmethods reachable from them.

The role of the event call graph is to provide information regarding thepart of the application code that is responsible for handling the fired event.We must note that event call graphs do not partition the application code, assignificant overlap can occur between events. In practice, event call graphs canbe extracted from the application call graph once event handlers are known.As defined by Memon in [9], GUI test cases are basically an ordered sequenceof GUI events. As such, we next define the event call graph coverage.

1Sequence-2 length coverage is actually event-interaction coverage.

Page 9: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

USING STATIC ANALYSIS IN COVERAGE CRITERIA FOR GUI APPLICATIONS 7

Definition. Event call graph coverage. Given a GUI test case T withevent sequence {e1, e2, ..., en}, we define the event call graph coverage of eventei, with 0 < i ≤ n as the ratio of source code statements covered by T to allstatements from the set of methods in ei’s event static call subgraph.

While dynamic analysis methods such as code instrumentation measureactual code coverage, call graphs obtained via static analysis provide informa-tion regarding all methods that can be executed. These include both methodsnot executed due to test case context as well as unreachable methods. Asdetailed above, it is possible that running a test case will result in running agiven method many times and with different coverage levels. For this case, wedefine the inclusive event call graph coverage, that takes into account the bestcode coverage for each method exercised during a GUI test case.

Definition. Inclusive event call graph coverage. Given a GUI test caseT having event sequence {e1, e2, ..., en}, we define the inclusive event call graphcoverage of event ei, with 0 < i ≤ n as the ratio of source code statementscovered by T to all statement from the set of methods obtained by the reunionof all methods from the event call graphs of events in Eset = {e1, e2, ..., ei},with maximum achieved statement coverage taken into consideration for eachmethod.

The definitions above enable us to define a new metric for the coverageof a GUI test case, that expresses how the test case exercises all coverablemethods.

Definition. Test case call graph coverage. Given a GUI test case T withevent sequence {e1, e2, ..., en}, we define the call graph coverage of test case Tas the inclusive event call graph coverage of event en.

When compared with established metrics such as class, branch or state-ment level coverage, our metrics facilitate understanding of GUI applicationsby highlighting the region of application code responsible for handling eventsunder test. Furthermore, our metrics facilitate both program comprehensionas well as fine-tuning tests to maximize code coverage. We must note that inmany cases, call graph coverage cannot be precisely computed, as to the bestof our knowledge there are no tools able to eliminate all redundant methodcalls within application call graphs [8]. As call graph creation errs on theside of over-approximation, there is the distinct possibility of 100% call graphcoverage being unobtainable due to the presence of uncallable methods in thecall graph. Considering all this, we posit that our coverage metric can be auseful measure in estimating how a test suite exercises GUI application code.It also has the advantage of being usable in designing updated test cases thatwill increase coverage.

Page 10: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

8 ARTHUR-JOZSEF MOLNAR

3. Conclusion and future work

In order to become useful, our theoretical foundation must be backed bysoftware tooling. Presently, our tooling allows measuring event call graphcoverage for GUITAR test cases [7] while jSET allows calculating event callgraphs [2, 3]. Furthermore, the JETRacer tool [4] allows capturing Java eventinformation with ongoing work to enable transmitting coverage data.

We believe our contributions have better relevance than statement-basedmetrics for GUI applications. Our current work is focused on leveraging ourcodebase for creating software tools to enable measuring test case call graphcoverage for GUI applications. Our expected result is an open-source systemintegrated with established GUI testing tools such as JFCUnit and GUITAR[7] and which provides measurement of our coverage metrics. Once available,we aim to undertake a study detailing how event call graph coverage comparesto established metrics in bug detection rate.

References

[1] Izzat Alsmadi. Using mutation to enhance gui testing coverage. IEEE Softw., 30(1):67–73,January 2013.

[2] Molnar Arthur-Jozsef. jSET - Java Software Evolution Tracker. Studia Informatica UBB,Volume LVI, Number 3, Cluj-Napoca, pages 15–20, September 2011.

[3] Molnar Arthur-Jozsef. A software repository and toolset for empirical software research.Studia Informatica UBB, Volume LVII, Number 1, Cluj-Napoca, March 2012.

[4] Molnar Arthur-Jozsef. JETracer - A Framework for Java GUI Event Tracing. In to appearin, Proceedings of the 10th International Conference on Evaluation of Novel Approachesto Software Engineering, ENASE ’15. SCITEPRESS, 2015.

[5] Mary L. Soffa Atif M. Memon and Martha E. Pollack. Coverage criteria for GUI testing.In Proceedings of the 8th ESEC held jointly with 9th FSE, pages 256–267, New York, NY,USA, 2001. ACM Press.

[6] Gordon Fraser and Andreas Zeller. Mutation-driven generation of unit tests and oracles.In Proceedings of the 19th international symposium on Software testing and analysis,ISSTA ’10, pages 147–158, New York, NY, USA, 2010. ACM.

[7] Daniel Hackner and Atif M. Memon. Test case generator for GUITAR. In ICSE ’08: Re-search Demonstration Track: International Conference on Software Engineering, Wash-ington, DC, USA, 2008. IEEE Computer Society.

[8] Ondrej Lhotak. Comparing call graphs. In Proceedings of the 7th ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering, PASTE’07, pages 37–42, New York, NY, USA, 2007. ACM.

[9] Atif Muhammed Memon. A comprehensive framework for testing graphical user inter-faces. PhD thesis, 2001. AAI3026063.

Department of Computer Science, Faculty of Mathematics and ComputerScience,Babes-Bolyai University, 1, M. Kogalniceanu, Cluj-Napoca 400084, Ro-mania

E-mail address: [email protected]

Page 11: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 9–12

FORMAL VERIFICATION OF LARIS PROGRAMS USING

SESSION TYPES AND FIRST ORDER LOGIC

KISS TIBOR (1)

Abstract. Choosing the DSL LARIS (LAnguage for Railway Interlock-ing Specifications) to develop control software for distributed railway in-terlocking systems can give us a lot of advantage over the general purposelanguages. We present an extension of the LARIS language with sessiontypes and first-order logic to model the communication between railwayentities which improves the safety and reliability of these systems. We eva-luate the feasibility of our approach on a case study in railway interlocking.

1. Introduction

A domain-specific language (DSL) is a small, usually declarative, languagethat consists of elements and relationships that directly represent the logicof the problem space. Consequently, DSLs embody domain knowledge anddomain experts themselves can understand and validate DSL programs whichis very important from the validation perspective.

The DSLs elements could be well defined, and in this case they can becombined according to some well defined principles, but this is not the generalcase. In general we have a set of abstract elements and principles which mustbe extended and refined to have some actual elements and connection princi-ples. The process of defining these elements and principles is very importantfrom the development of safety critical systems perspective, because this canenable us to identify automatic verification of global safety rules at the DSLlevel.

Defining the previously mentioned process in LARIS DSL is more challeng-ing, from several points of view. First, there is no language support to specifyformal global constraints at the moment. Secondly, assuming that these pre-viously mentioned constrains are specified, it would be very challenging to

Received by the editors: 2015.04.08.1998 CR Categories and Descriptors. D.2.4 [SOFTWARE ENGINEERING]: Soft-

ware/Program Verification – Formal methods; D.3.4 [PROGRAMMING LANGUAGES]: Processors – Code generation.

Key words and phrases. Proof-based development, Program Verification, Session types,Scribble.

c©2015 Babes-Bolyai University, Cluj-Napoca

9

Page 12: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

10 KISS TIBOR

verify them, because of the abstract and incomplete nature of the softwarespecification.

Analyzing the current industrial practices, along with the state of theart tools to verify geographical railway interlocking software, we concludedthat without a way to routinely and reliably build concurrent and distributedsystems, following some correct-by-construction principles, the correctness ofthese systems can not be ensured. On the other hand, trying to follow thefunctional development principle [2, 1] and to explore the state space of sucha system, it seems to be also generally impossible [1]. The verification leadsapproximately always to state explosion, therefore a new methodology to verifyinterlocking software correctness is highly welcome.

According to the previously mentioned problems, the goal of this paper isto extend the LARIS in order to enable a larger number of system require-ments specification and formal verification without compromising the currentdevelopment process. Our contribution is twofold:

• The extension of Scribble with some first order logic specification;• The translation of the ”Scribble” local protocol into pre- and post-

conditions plus static verification rules in LARIS.

2. Verification principles

The central idea of session types is to parameterize a channel with sometype that represents a protocol, which the type system then enforces. InLARIS, there is no mechanism to encode a protocol. We may enforce a pro-tocol using some special interface constraints, named local protocol type con-straints. For the generation of local protocol type constraints, we decided touse the Scribble multiparty protocol specification language. Our developmentwork-flow starts from the explicit specification of the global protocols in Scrib-ble, similarly to existing informal approaches, such as sequence diagrams andcommunication diagrams. We modified Scribble in a way that it enables thespecification of telegrams and linear temporal logic properties.

Intuitively, a choreography is well-typed, provided that shared channelsare used and processes play roles according to the local protocols [Table 2],and session channels are used according to global session protocols [Table 1].Therefore, after the specification of the global protocols, the next step in the

global G ::= A− > B : 〈U〉;G (communication)A− > B : {li : Gi}i∈I (branching)end endt (call)

U::= S | G@AS::= bool | int | string | ..

Table 1. Global protocol

Local T ::= K!〈U〉;T sendK?〈U〉;T receiveK ⊕ {li : Ti}i∈I selectionK&{li : Ti}i∈I branchingµt.T |t|end end

Table 2. Local protocol

Scribble framework is the projection of local protocols, for each role, from

Page 13: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

FORMAL VERIFICATION OF LARIS PROGRAMS USING SESSION TYPES 11

the global protocols. Having this specification, we must enforce it as a typediscipline in LARIS, in order to be able to verify the specification correctness.

To enforce this discipline, we use the session type interface, which enablesthe identification of the roles in order to be able to verify the type disciplinecorrectness.

In order to enable the safety verification of these aspects in LARIS, somewell known formalisms must be adopted or a new formalism must be invented.We were inspired by [4] to transform π -calculus in a specification languagewith pre- and post-conditions. Intuitively, this transformation must be a one-to-one projection mechanism from the local protocol specification (Table[2])into a specification method in LARIS, otherwise the correctness of the ver-ification can not be assumed. We have identified the translation principles(Table[3]), which enable the total translation of the protocol specification intostatic verification rules, consisting of existential verification rules plus staticspecifications in form of Hoare logic pre- and post-conditions. These condi-tions could be verified subsequently with existing tools such as [3, 5], to provethe type discipline correctness.

π -calculus Static specifications

k!〈u〉P{y/u};Tx ∈ N

{k!〈u〉P{y/u}(x) ∧Q}k!〈u〉{k!〈u〉(x+ 1)P{y/u} ∧Q}

k?〈u〉P{y/u};T ∃mesk?u();mesK?U() ≡ k?〈u〉P{y/u}

k ⊕ {liPi{y/u} : Ti}i∈I ∀liPi{y/u} : Ti;mesk?li() ≡ k?〈liPi{y/u}〉

K&{liPi{y/u} : Ti}i∈I

{liPi{y/u} : Ti}i∈I ; {xi ∈ N}i∈I

{k!〈li〉(xi)Pi{y/u} ∧Q}k!〈li〉{k!〈li〉(xi + 1)Pi{y/u} ∧Q}

Table 3. Local protocol translation rules

3. An Example

We illustrate the previous theory with a route verification problem. Ac-cording to Banci [1] a route is available if no part of the route is already locked.The verification process starts by sending a route verification request from thelogistic layer to the interlocking layer. This request must be sent to one ofthe route end elements which must be a light signal. Depending on the lightsignal internal state, two scenarios are possible: In the first scenario, whenthe signal is allocated, it will answer with a fail message to the logical layer.In the second scenario when the signal is not allocated, the request must bedelegated toward to the next route element in order to verify its state. Havingthe protocol specification from Listing[1], it can be projected automatically tothe semaphore methods according to Table [3] as can be seen in [2].

Page 14: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

12 KISS TIBOR

1type <te l eg ram>”T. x t s ” from”A16” as RError ;

2type <te l eg ram>”T. x t s ” from”A06” as R;

3g l o b a l p r o t o co l RV( r o l e LL , r o l eS ,

4 r o l e LE , r o l e RE){5@ R. Index=0 ∧ R. S ize>0

6 v e r i f y (R) from LL to S ;

7 cho i ce at S {8 do REV(S as SE , LE as DE) ;

9 } or {10 do REV(S as SE ,RE as DE) ;

11 } or {}12 cho i ce at S {13@ ∀ i∃ j . i<R. S i z e∧ j∈Elements∧14@ j . i d=R[ i ] . i d∧ f r e e ( j )

15 f r e e (ROk) from S to LL ; } or {16@ ∃ i , j . i<R. S i z e∧ j∈Elements∧¬ f r e e ( j )

17@ ∧ j . i d=R[ i ] . i d∨¬( j . i d=R[ i ] . i d )

18 a l l o c a t e d ( RError ) from S to LL ;}}

Listing 1 . Route verification protocol

1LSC Semaphore (EA,EB : Component ;2Pa , Pb : Port ; TSL : I n t )3 implement r o l e RV. S(

4LL=[Log , l o g ] , LE=[EA, Pa ] ,

5RA=[EB, Pb ] ) =

6

7 i n i t i a l s k i p ;

8@ R. Index=0 ∧ R. S ize>0

9mes l o g ? A06 (RL :R) =

10 i f STATE = ALLOC && R [ 0 ] . i d != TSL

11@ ∃ i , j . i<R. S i z e∧ j∈Elements∧¬ f r e e ( j )

12@ ∧ j . i d=R[ i ] . i d∨¬( j . i d=R[ i ] . i d )

13then Log |> l o g ! A16 ( s e l f ,ALLOC)

14 e l s e15 i f RL[0]== t r u e

16 then EA |> Pa ! A22 (RL , 1 )

17 e l s e EB |> Pb ! A22 (RL , 1 ) ;

Listing 2 . LARIS semaphore

4. Conclusion

In this paper we have demonstrated that session types can be combined andused with a domain specific programming language like LARIS. We observedthat combining Scribble with LARIS can provide a lot of benefits in the veri-fication and validation of a geographically distributed interlocking systems. Amajor benefit of this combination is the local verification of global properties.We encoded the local protocol specification into some static verification rules,in addition with some specifications in form of pre- and post-conditions to en-sure the safety properties correctness of this typing discipline. We have shownour concept correctness on a railway interlocking problem implementation inScribble and LARIS. References

[1] Michele Banci and Alessandro Fantechi. Geographical versus functional modelling bystatecharts of interlocking systems. Electron. Notes Theor. Comput. Sci., 133:3–19, May2005.

[2] Andrea Bonacchi and Alessandro Fantechi. On the validation of an interlocking systemby model-checking. In Frdric Lang and Francesco Flammini, editors, Formal Methods forIndustrial Critical Systems, volume 8718 of Lecture Notes in Computer Science, pages94–108. Springer International Publishing, 2014.

[3] Erik Poll David Cok, Joe Kiniry. Esc/java2, 2015.[4] Tony Hoare and Peter O’Hearn. Separation logic semantics for communicating processes.

Electronic Notes in Theoretical Computer Science, 212(0):3 – 25, 2008. Proceedings of theFirst International Conference on Foundations of Informatics, Computing and Software(FICS 2008).

[5] Yannick Moy. Frama-c jessie plug-in, 2015.

(1) Department of Computer Science, Faculty of Mathematics and ComputerScience Babes-Bolyai University, Cluj-Napoca

E-mail address: [email protected]

Page 15: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 13�16

DOMAIN MOBILE AMBIENTS FOR NETWORK ROUTING

SCHEME

GABRIEL CIOBANU(1) AND DAN COJOCAR(2)

Abstract. Ambient calculus is a calculus for mobile computing intro-duced to describe the movement of processes or devices. Until now thedomain capability of an ambient was de�ned like a static resource. In thispaper we add the composition and choice operations for domain attributein order to express di�erent addressing and routing schemes. The newformalism can be used to easily describe routing schemes like anycast andmulticast.

1. Introduction

Ambient calculus was introduced by Cardelli and Gordon in 1999 as a needto express the movement of processes or devices, even between di�erent admin-istrative domains [1]. The ambient calculus di�ers from other formalisms suchas π-calculus [2] in such that the computational model is based on movement

instead of communication. An ambient represents a unit of movement.In this paper we extend the use of composition and choice operations, that

were de�ned in [1] for process operations, to be used on domain attributealso. Using these two operations we are able to express routing and addressingscheme like: unicast, anycast and multicast.

The rest of this paper is structured as follows. Section 2 introduces themobile ambients and Coordination of mobile agents formalism. In Section 3we present the formalism changes and the reductions rules that address thedomain attribute, and how to apply the changes using a DNS anycast sample.Conclusions and further works are presented in Section 4.

Received by the editors: April 10, 2015.2010 Mathematics Subject Classi�cation. 14D15,68M14.1998 CR Categories and Descriptors. D.2.4 [SOFTWARE ENGINEER-

ING]: Software/Program Veri�cation � Formal methods; C.2.4 [COMPUTER-COMMUNICATION NETWORKS]: Distributed Systems � Distributed applications.

Key words and phrases. formal methods, mobile ambients, DNS lookup.

c©2015 Babe³-Bolyai University, Cluj-Napoca

13

Page 16: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

14 GABRIEL CIOBANU(1) AND DAN COJOCAR(2)

2. Mobile Ambients

Cardelli and Gordon introduced the mobile ambients with the main pur-pose to model the mobility of agents that are involved in distributed computing[1]. An ambient was de�ned as a boundary place where computation will hap-pen (laptop, web-page, network routing equipments, etc.). Moving operations,like go, in and out were de�ned in order to express the movement between am-bients. An ambient has a name, a collection of local capabilities which controlthe ambient, and a collection of subambients.

3. Domain Mobile Ambients Behavior

In this section we present our proposal to extend the model presented in [3].By overloading the domain attribute, in order to enhance the local knowledgeof an ambient, we can encapsulate the domain choice as an action. Doing sowe are able to express or formalize TCP/IP unicast, anycast, multicast andbroadcast routing schemes [4].

3.1. Extending Domain Attribute of an Mobile Ambient. To representan endpoint group, we use the notation dnm, where:

• m - represents the total number of nodes in the domain.• n - represents the number of nodes that are used.

Using the above notations for each routing scheme we can de�ne the followingendpoint groups:

• unicast group = d11 ≡ d1 - the client request will be routed to the single

node that represents the unicast group.• anycast group = d1

m ≡ d1 - the client request will be routed to only onenode that is part of the anycast group. Here the anycast group has mnodes, but in this case we will contact only a single node.

• multicast group = dnm ≡ dn - the request will be routed to n destinationsfrom the total of m nodes of a network. n represents the total numberof nodes in this multicast group, n being less then m.

• broadcast group = dmm ≡ dm - the request is routed to all the availablenodes, n from the multicast group is equal to m.

3.2. Anycast DNS Lookup. A scenario where a client that performs DNSqueries, using two public DNS servers that are scattered between three loca-tions, is presented in Figure 1. Because we are using anycast addresses thequeries will be handled by the closest server [5].

When performing a DNS lookup query the following steps are performed:

• Step 1. - the client is using the 8.8.8.8 address because this is the �rstcon�gured nameserver, for his DNS lookup query.

Page 17: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

DOMAIN MOBILE AMBIENTS FOR NETWORK ROUTING SCHEME 15

Server A8.8.8.8

Server B8.8.8.8

Server C8.8.8.8

R1

R3

R6

R2

R5R4

/etc/resolv.confdomain abc.comnameserver 8.8.8.8nameserver 8.8.4.4

Server D8.8.4.4

Server E8.8.4.4

R0

Figure 1. DNS lookup using anycast address.

• Step 2. - the request is processed by R0 router. R0 knows that serverA, B and C all have the 8.8.8.8 anycast address con�gured, and becausethe server A is the closest server will forward the DNS lookup to routerR1.

• Step 3. - the router R1 is simply forwarding the client request to serverA.

• Step 4. - server A is processing the client request and responds with acorresponding message.

Considering the DNS lookup with mobile ambients we can express theabove logic like this:

dns_lookup : = (dns_request∆t1(l,h,d1)

[send_request] , process_error)

send_request = send∆t2[out∆t3client.go∆t4 .in∆t5server

]process_error = (dns_request∆t6

(l,h,d2)[send_request] , display_error)

display_error =! < error_message >∆t7

Where d1 has the 8.8.8.8 address associated, the �rst con�gured name-server, and d2 is using 8.8.4.4 address, the failover nameserver, used if an erroris received from the �rst dns_request query. If after the second attempt wereceived an error, a failure message is displayed to the client.

When receiving a request, a router R is performing the following actions:

process : = (router∆t(l,h,d) [forward_request] , discard_request)

forward_request = send∆t2[out∆t3router.go∆t4 .in∆t5next_hop

]discard_request = send∆t6

[out∆t7router.go∆t8 .in∆t9client

]next_hop = send∆t10 [out∆t11router.go∆t12 .in∆t13forward_request

+ server]

Page 18: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

16 GABRIEL CIOBANU(1) AND DAN COJOCAR(2)

The next hop from a router could be the destination server or another router.For each router we are doing the same action: check to see if we can forwardthe request to one of our servers or to a next router. If the ∆t expires, in ourcase the TTL value is decremented and reaches zero, the router will discardthe request and is sending an error code to the client [6].

4. Conclusion and Further Works

By extending the coordinated mobile agents with composition and choiceon the domain attribute level we are able to formalize all the routing schemesde�ned in IPv4 and IPv6. The evolution of ambients is illustrated with anexample from real life, DNS routing scheme.

Having a concise way to express the movement is helping in validating andcomparing classic routing algorithms on all type of networks, independent ofthe used addressing scheme. The formalism can be used to express all sorts ofinteractions not only the network related ones.

References

[1] L. Cardelli, A. D. Gordon, and G. Ghelli, �Mobility types for mobile ambients,� in ICAL

'99: Proceedings of the 26th International Colloquium on Automata, Languages and Pro-

gramming. London, UK: Springer-Verlag, 1999, pp. 230�239.[2] R. Milner, Communicating and mobile systems: the π-calculus. New York, NY, USA:

Cambridge University Press, 1999.[3] G. Ciobanu, �Coordinated mobile agents,� Proceedings of the Romanian Academy Series

A-Mathematics Physics Technical Sciences Information Science, vol. 10, no. 1, pp. 73�79,2009.

[4] J. Postel et al., �Rfc 791: Internet protocol,� 1981.[5] S. Sarat, V. Pappas, and A. Terzis, �On the use of anycast in dns,� in SIGMETRICS '05:

Proceedings of the 2005 ACM SIGMETRICS international conference on Measurement

and modeling of computer systems. New York, NY, USA: ACM, 2005, pp. 394�395.[6] M. Allman, V. Paxson, and W. Stevens, �Rfc 2581: Tcp congestion control,� 1999.

(1) Romanian Academy, Institute of Computer Science, Blvd. King Carol

I, Ias,i 700505, Romania

E-mail address: [email protected]

(2) Babes,Bolyai University, Department of Computer Science, M. Kog l-

niceanu Street, Cluj-Napoca 400084, Romania

E-mail address: [email protected]

Page 19: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 17�20

ENVIRONMENT MODEL-BASED TESTING OF REACTIVE

SYSTEMS: A CASE STUDY ON A SCADE MODEL

ANNAMÁRIA SZENKOVITS (1)

Abstract. Model-based testing can facilitate automatic test generation,thus, it can signi�cantly decrease testing costs. This paper presents a casestudy where model-based testing was performed on a SCADE (Safety Crit-ical Application Development Environment) system. Test inputs were gen-erated automatically based on a non-deterministic, realistic environmentmodel expressed in Lutin. The aim of the case study was to investigatewhether such a realistic test environment can increase model coverage.

1. Introduction

Model-based testing is a widely used technique in the �eld of veri�cationof reactive systems. The technique consists of �ve main steps [UL07]: First,the system under test (SUT) and/or its environment is modelled. Then, ab-stract test cases are generated from the model � usually automatically or semi-automatically. In the next step, the abstract tests are concretized in order tomake them executable. After this step, the tests are executed on the SUT andverdicts are assigned (fail/pass). Finally, the results are analysed.

Reactive systems are in continuous interaction with their environment.During their life cycle, they continuously read the sensor data coming fromthe environment, update their internal state, then write the outputs to theiractuators. The behaviour of such reactive systems can be described usingsynchronous languages [HCRP91].

In this case study, model-based testing was performed on a SCADE [Dor13]model. SCADE is a synchronous, widely used industrial toolset, especiallyfor designing avionic and railway systems. For modelling the environment ofthe SUT, the Lutin language [RRJ08] was chosen. Similar to SCADE, Lutin

Received by the editors: April 30, 2015.2010 Mathematics Subject Classi�cation. 68N30, 68T35.1998 CR Categories and Descriptors. D.2.5 [Software Engineering]: Testing and De-

bugging � Testing tools (e.g., data generators, coverage testing);Key words and phrases. model-based testing, reactive systems, SCADE.

c©2015 Babe³-Bolyai University, Cluj-Napoca

17

Page 20: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

18 ANNAMÁRIA SZENKOVITS

is also a synchronous language, suitable to express the logic of realistic testenvironments.

The aim of the case study is to investigate whether test cases generatedbased on a realistic Lutin environment can improve the coverage of the SUTmodel. Similar case studies are described in [JDDML14]. Here, environmentmodel based testing was performed with Lutin, but the requirements coveragewas analysed instead of the model coverage.

2. Environment model-based testing of reactive systems

The reactive system in current case study is the SCADE model of an air-plane's roll control system. The Lutin language was used to model the environ-ment, but also to simulate the SUT and to generate test inputs. The SCADESUT read the inputs from the Lutin environment, updated its internal state,and generated some outputs. This cyclic behaviour continued for a speci�ednumber of iterations.

By using Lutin, we were able to express non-deterministic behaviour, butalso to perform guided random exploration of a state space. Because in in-dustrial, real-life problems the environment is often underspeci�ed, the non-deterministic nature of Lutin makes it suitable to model realistic test scenarios.

There are two main elements in Lutin's syntax that enable us to performguided random exploration. On one hand, we have the non-deterministic choiceoperator. Weights can be assigned to the branches of this choice operator, thisway we can in�uence how the environment reacts. On the other hand, non-determinism can be expressed in Lutin with random loops, which are de�nedin terms of expected number of iterations. The above mentioned control struc-tures were used to create an environment model for the SCADE SUT. Theenvironment model is presented more in detail in section 3.

In order to evaluate the performance of the automated test method, theSCADE Model Test Coverage (MTC) tool was used. The MTC tool retrievescoverage data of the SUT model based on the MC/DC (modi�ed condition/de-cision coverage) criterion [AO08]. The MC/DC is a widely-used coverage crite-rion in the model-based testing of SCADE models and of safety-critical systemsin general.

As stated in section 1, one of the goals of this case study was to decidewhether a higher model coverage can be obtained with a realistic environmentmodel. In order to investigate this question, the coverage rate obtained by therealistic environment was compared to the one obtained by some test inputsgenerated at random.

Page 21: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

ENVIRONMENT MODEL-BASED TESTING OF REACTIVE SYSTEMS 19

(a)

Length of the Lutin Randominput sequence environment environment

5 68.42% 54.38%10 75.43% 71.92%20 84.21% 81.70%50 91.22% 91.22%100 91.22% 91.22%

(b)

Figure 1. (A) Inputs generated with Lutin. (B) MTC coverage rates.

3. Experimental Results

The case study focused on the Roll Control SCADE model. The modelwas provided by Ansys, as part of the SCADE installation package. Its mainfunctionality is to calculate a plane's roll rate, based on the joystick commandand the left and right adverse yaw rates.

For designing a realistic environment model in Lutin, the code from theLutin manual 1 was used and adapted to the Roll Control SCADE model. TheLutin code simulates the change of the joystick command and left and rightadverse yaws, respectively. Starting from an initial value chosen at random,the values start to increase or decrease by a random number, until they reacha certain minimum or maximum. Then, their value start to change in theopposite direction. The direction of the change is also chosen at random, usingLutin's choice operator. The number of iterations is in�uenced with Lutin'snon-deterministic loop. Figure 1(A) illustrates the inputs generated with Lutinafter 50 steps.

In order to analyse the coverage obtained with the Lutin environment, in-put sequences of length 5, 10, 20, 50 and 100 were generated. Then, randomsequences with the same length were generated. The length of the input se-quences was chosen empirically. The coverage obtained with the two methodswas analysed with the MTC tool. The results are summarized in table 1(B).

A signi�cant improvement in the coverage rate can be observed in the caseof the Lutin environment compared to the random one, where the length of theinput sequences was 5, 10 and 20. However, no improvements can be observedin the case of the Lutin environment for longer input sequences. This is dueto the fact that the SUT chosen for the case study is a small SCADE modelwith few inputs and small inner state space. Thus, a high model coverage canbe obtained even with random inputs, if the number of inputs is high enough.

1http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lurette/doc/lutin-man.pdf,downloaded on April 24, 2015

Page 22: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

20 ANNAMÁRIA SZENKOVITS

4. Conclusion and Future Work

We presented a case study where environment-model based testing wasperformed on a reactive system is form of a SCADE model. Experimentalresults show that the model's coverage rate increased for short input sequencesof length 10, but no improvement could be observed for longer sequences.

Further research should test the method on a more complex SCADE model,coming from our industrial partner, Siemens. Furthermore, to fully bene�t ofthe possibilities o�ered by Lutin's syntax, we plan to complete the choiceoperators with weights. This way, we will have more control over the non-determinism of the environment. In addition, we plan to experiment withdi�erent learning techniques in order to improve the Lutin parameters, andincrease the model coverage even more, with input sequences as short as pos-sible.

5. Acknowledgement

This material is based upon work supported by the Siemens internationalRailway Automation Graduate School (iRAGS) and the SCADE AcademicProgram. Thanks for Erwan Jahier from Verimag Research Center (Grenoble,France), for providing technical support with Lutin.

References

[AO08] Paul Ammann and Je� O�utt. Introduction to Software Testing. CambridgeUniversity Press, New York, NY, USA, 1 edition, 2008.

[Dor13] Francois Xavier Dormoy. Scade 6 a model based solution for safety criticalsoftware development. ERTS 2008, 2013.

[HCRP91] N. Halbwachs, P. Caspi, P. Raymond, and D. Pilaud. The synchronous data�ow programming language lustre. Proceedings of the IEEE, 79(9):1305�1320,Sep 1991.

[JDDML14] Erwan Jahier, Simplice Djoko-Djoko, Chaouki Maiza, and Eric Lafont.Environment-model based testing of control systems: Case studies. In ErikaÁbrahám and Klaus Havelund, editors, Tools and Algorithms for the Construc-tion and Analysis of Systems, volume 8413 of Lecture Notes in Computer Sci-ence, pages 636�650. Springer Berlin Heidelberg, 2014.

[RRJ08] Pascal Raymond, Yvan Roux, and Erwan Jahier. Lutin: A language for speci-fying and executing reactive scenarios. EURASIP J. Emb. Sys., 2008, 2008.

[UL07] Mark Utting and Bruno Legeard. Practical Model-Based Testing: A Tools Ap-proach. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2007.

(1) Department of Mathematics and Computer Science, Babe³-Bolyai Uni-

versity, 1 M. Kog lniceanu St., 400084 Cluj-Napoca, Romania

E-mail address: [email protected]

Page 23: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 21–24

FUNCTIONAL PROGRAMMING FRAMEWORK FOR

CYBER-PHYSICAL SYSTEMS

ZOLTAN TOSER (1), RICHARD BELLON (1), DAVID HORNYAK (1),

ZOLTAN HORVATH (1), TAMAS KOZSIK (1), ROBERT-ADRIAN RILL (1,2),

AND ANDRAS LORINCZ (1)

Abstract. Cyber-Physical Systems (CPS) should be capable of dealingwith loosely coupled subsystems, including human actors in stochastic en-vironments. Events of such systems are localized in space and time. Wedefine such volumes as the domain of dependence. Other events cannotinfluence this volume except as providing the input to it. We model thedomain of dependence as an I/O system. We propose a novel solution forthe design and the implementation of building blocks for complex CPS’soffering fast verification and decision making. The basis of the architectureis functional programming (FP). Our proposal concerns design principles.

1. Introduction

In many applications, hierarchical modular design of input/output systemsare sufficient. Functional programming (FP) deals with such applications byenforcing side effect free design. This approach can promote fast verifiabilityby limiting combinatorial explosion of the cases that may occur.

However, Cyber-Physical Systems (CPS) have complex environments in-cluding humans in the control loop and that involves stochastic processes thatmay spoil the side effect free property for the whole system.

It is critical to ensure the side effect free property in spite of environmentaldisturbances. This condition may be satisfied to a great extent by includingrobust controllers for the physical entities. The price to pay is that one endsup with a weak side effect free condition. On the other hand, the gain is thatthe system becomes an ε-Markov Decision Process (ε-MDP) with attractive

2010 Mathematics Subject Classification. 68N18, 68M14.1998 CR Categories and Descriptors. D.1.1 [Programming techniques]: Applicative

(Functional) Programming; D.2.4 [Software engineering]: Software/Program Verification– Reliability .

Key words and phrases. cyber-physical systems, functional programming, side effect, fac-tored reinforcement learning.

c©2015 Babes-Bolyai University, Cluj-Napoca

21

Page 24: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

22 ZOLTAN TOSER ET AL.

optimization properties [1] including factored MDP’s [2] as well as polynomialconvergence guarantees for the learning step.

Our contribution here is that we introduce the concept of weak side effectfree property and show how to include it into the FP framework. The firststep in this direction has been published [3] and will be extended considerablyhere. Restrictions in length do not allow us to detail the different applicationsthat we started to develop [4, 5].

2. Terminology

Task Oriented Programming [6], a kind of FP is about tasks and theirfeatures, including if they have been executed or not. In turn, beyond thefinal output value, intermediate results are also communicated and used. Atask is a unit of computation which has inputs and outputs. While it computesits final output which is called a stable value, it may yield intermediate results,the unstable values. Stable values of tasks are similar to the output values offunctions in FP. However, processing of the unstable values is slightly differentand depends on the concept of parent–child relation between tasks.

A task may combine other tasks to compute its result. These kind of tasksmake use of combinators and sometimes a task itself is called a combinator.The combined tasks are the subtasks of the combinator. A task which is nota combinator is called primitive task. The way that a combinator launches itssubtasks and combines their results can vary, e.g.:

• Launching the tasks sequentially: the output of the (n − 1)th task isthe input of the nth task.

• Launching the tasks in parallel: tasks have the same input, they areprocessed in parallel and their outputs are returned in a given order.

The name “task” may refer to both the task type and the task instancewhich is disambiguated by the context. Task types are like blueprints, like aclass in object oriented programming. They should be instantiated to get arunnable entity.

Task types have a signature, like a public interface, consisting of:

• the number and types of the input parameters,• the type of the unstable values,• the type of the stable value.

Similarly to pure functions, a task is called referentially transparent, if– for all inputs – it can be replaced with its stable value (for the actual input),without modifying the program’s behavior (apart from timing). Reading avalue from a table (for which the task has exclusive access) belongs to thiscategory. However, executing tasks producing unstable intermediate values ina distributed environment brings nondeterministic behaviour into the workflow

Page 25: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

FUNCTIONAL PROGRAMMING FOR CPS 23

process. Time critical verification of workflow management under uncertain-ties calls for low complexity scheduling algorithms.

3. Side effect free tasks

3.1. Strictness of pure languages. A side effect free task represents a state-less unit of computation, thus the output (stable value) for a given input doesnot depend on the history of preceding executions and thereby they have theMarkov property. However, they may use variables with local scope – bytradition, this is not called state in this context. They have no observableinteraction with the world or with other tasks. In the literature, temporalside effects are usually not considered although this property is necessary forreferential transparency. Note that giving input to a side effect free task (i.e.starting a new instance) is not a side effect, leaving alone the temporal one.

3.2. Weak side effects. The side effect free term is a property of a singletask. However, the physical environment may disturb individual tasks. On-going tasks belong to the environment of the other tasks. They may disturbthe operations of the others, meaning that the value of the output becomes astochastic quantity due to the disturbances. This typically non-symmetricalcausal relation corrupts the conditions of FP and should be overcome by de-sign in any CPS. In general, there is no perfect solution, so we need to relaxthe strong side effect free condition and make the compromise that we keepsuch disturbances (interactions, or side effects) below a prescribed ε threshold.Engineers can add (robust) controllers to achieve this goal.

We introduce the following concept: the relation between a task and itsenvironment is called side effect free in the weak sense if no changes in theenvironment may affect the output of the task above the prescribed threshold.The result is that ε-optimal performance can be guaranteed [1]. On the otherhand, if the fluctuation of the output is larger than the prescribed threshold,then we call it an anomaly. In a properly designed system such anomalies aredetected and the workflow of the CPS is changed by means of fallback plans.

Note that FP principles ensure side effect free properties in the strongsense. Now, if we build our system from input/output units with side effect freeproperties in the weak sense and organize all units according to the principlesof FP (i.e. use combinators which are side effect free in the strong sense), thenour full system will be side effect free in the weak sense.

4. Verification

4.1. Functional programming. In FP, the referentially transparent prop-erty is used to reason about the program, that is, the fact that identifiersare used for values, rather than for references whiches value may change overtime. This property can facilitate reasoning about the correctness of the result

Page 26: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

24 ZOLTAN TOSER ET AL.

by using static analysis methods. Most of these methods work on the sourcecode, not on the compiled binaries. On the other hand, temporal features ofthe program, such as timing and scheduling cannot be verified by replacingtasks with their stable values in combinator hierarchies.

4.2. Tasks with time constraints. In the applied task-oriented frameworkRea [7], timing constraints need to be introduced and we added a probabilisticWorst Case Execution Time (pWCET) distribution object to each primitivetask. During the execution of such tasks, the expected execution time ismonitored by design. If the expected value exceeds the limit allowed, thenworkflow management is invoked. Fast experimental estimations of pWCETsare in the focus of ongoing research efforts (see [8] and the references therein).

4.2.1. Acknowledgments. Research was supported by the European Union andco-financed by the European Social Fund (TAMOP 4.2.1./B-09/1/KMR-2010-0003) and by the EIT ICTLab grant on CPS for Smart Factories.

References

[1] I. Szita, B. Takacs, and A. Lorincz. ε-MDPs. J. Mach. Learn. Res., 3:145–174, 2003.[2] I. Szita and A. Lorincz. Optimistic initialization and greediness lead to polynomial time

learning in factored MDPs. In Int. Conf. Mach. Learn., pages 1001–1008, 2009.[3] T. Kozsik, A. Lorincz, D. Juhasz, L. Domoszlai, et al. Workflow description in Cyber-

Physical Systems. Stud. Univ. Babes-Bolyai, Inf., 58:20–30, 2013.

[4] A. Mihaly, Z. A. Milacski, T. Tettamanti, Z. Toser, I. Varga, and A. Lorincz. Cost andrisk sensitive decision making and control for highway overtaking maneuver. In 2015 Mod-els and Technologies for Intelligent Transportation Systems (MT-ITS) 3-5. June 2015.Budapest, Hungary. ISBN 978-963-313-142-8, 2015.

[5] Z. Toser and A. Lorincz. The cyber-physical system approach towards artificial generalintelligence: The problem of verification. In 8th International Conference, AGI 2015,Berlin, Germany, July 22-25, 2015, Proceedings, In press.

[6] R. Plasmeijer, B. Lijnse, S. Michels, P. Achten, and P. Koopman. Task-oriented program-ming in a pure functional language. In Proceedings of the 14th Symposium on Principlesand Practice of Declarative Programming, PPDP ’12, pages 195–206. ACM, 2012.

[7] David Juhasz, Laszlo Domoszlai, and Barnabas Kralik. Rea: Workflows for cyber-physical systems. In Central European Functional Programming School, volume 8606 ofLecture Notes in Computer Science, pages 479–506. Springer, 2015.

[8] Sebastian Altmeyer, Liliana Cucu-Grosjean, and Robert I Davis. Static probabilistic tim-ing analysis for real-time systems using random replacement caches. Real-Time Systems,51(1):77–123, 2015.

(1) Faculty of Informatics, Eotvos Lorand University, Budapest, Hungary

(2) Babes-Bolyai University, 1 M. Kogalniceanu St., Cluj-Napoca, 400084Romania

Page 27: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 25–28

METRICS-BASED REFACTORING STRATEGY AND

IMPACT ON SOFTWARE QUALITY

SIMONA MOTOGNA (1), CAMELIA SERBAN (1), AND ANDREEA VESCAN (1)

Abstract. In this article we propose a case-study for object-oriented de-sign assessment using software metrics. Our goal is to identify those designentities affected by “God Class” design flaw, to propose possible refactor-ings that could improve the system design and to evaluate the impact ofthe applied refactoring on software quality.

1. Introduction

Nowadays, software systems become very large and complex applications.They are the result of a process evolution, undergoing frequent modificationsthat affect their design quality. Therefore, repeated assessment of the systemsdesign should be made throughout the development lifecycle. This activityis time-consuming, because of design complexity, and automatic methods arerequired to evaluate system design. Software metrics are an alternative solu-tion, being a means for quantifying those aspects considered important for theassessment.

Our previous work [2] focused on developing a methodology for quantita-tive evaluation of object-oriented design based on static analysis of the sourcecode. To complete the interpretation of the obtained measurement results,we also proposed a new metric, named Design Flaw Entropy (DFE), whichmeasures the distribution of a specified design flaw among the analyzed designentities[7].

This paper focuses on applying this methodology and DFE metric in orderto detect ”God class” design flaws, and to validate the approach by conductingan evaluation of the most OO metrics before and after the refactorization.More precisely, after the interpretation of the obtained measurements results

2010 Mathematics Subject Classification. 68N30, 68T37.1998 CR Categories and Descriptors. code D. 2.8. [Software Engineering]: Metric –

Product Metrics; code D. 2.8. [Software Engineering]: Refactoring – Extract Method ;code D.1.5. [Pattern recognition]: Clustering – Fuzzy Clustering .

Key words and phrases. Software metrics, refactoring, fuzzy clustering.

c©2015 Babes-Bolyai University, Cluj-Napoca

25

Page 28: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

26 SIMONA MOTOGNA, CAMELIA SERBAN, AND ANDREEA VESCAN

which has the goal of identifying “suspect” design entities, we suggest possiblerefactorings and we study their impact regarding the design improvement.

2. Object-oriented design assessment process

2.1. Setting the assessment objectives. The first step of OOD assess-ment process is to establish the assessment objectives. In this study we aimto identify those design entities affected by “God Class” [6] design flaws. Con-sequently, the assessed entities, are the set of classes from the analyzed designsystem.

To detect a God Class, Salehie et al. [5] have related this design flawto a set of three heuristics [4]: i) distribute system intelligence horizontallyas uniformly as possible; ii) beware of classes with much non-communicativebehavior; iii) beware of classes that access directly data from other classes.

2.2. Metrics identification. Having identified some heuristics which are cor-related with “God Class” design flaw, our goal is to find for each heuristic rel-evant metrics. Looking at the above heuristics the conclusion drawn may be:the first rule suggests that it should be a uniform distribution of intelligenceamong classes, so it refers to high class complexity ; the second rule refers tothe level of intra-class communication; i.e. to weak cohesion of classes; thethird rule refers to classes that use a lot of data from other classes.

Thus, the selected heuristics are then related with the following metrics:Cyclomatic Complexity (CC), Lack of Cohesion Of Methods (LCOM) andEfferent Coupling at type level (EC). The Cyclomatic Complexity metric isdefined on methods. Adapted to the OO world, this metric [8] is also definedfor classes and structures as the sum of its methods CC.

2.3. Fuzzy-based God Class Detection and DFE metric. Having com-puting the metrics values, for each design entities which are classes, the nextstep is to identify the list of “suspect” entities, i.e those classes affected by“God Class” design flaw. In order to obtain these entities we use fuzzy cluster-ing analysis. This method overcomes the limitations of the existing approacheswhich use thresholds values for metrics, thus an entity (class) will be place inmore than one group (cluster), having different membership degree. Eachcluster of the obtained partition is analyzed in detail, in order to decide if itcontains “suspect” classes. A metric proposed in our previous work [7], DesignFlaw Entropy, provides an in-depth analysis regarding the distribution of theanalyzed design flaw (the degree of its spread) into the system. This metric iscomputed started from a fuzzy partition of design entities.

Page 29: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

METRICS-BASED REFACTORING STRATEGY 27

Table 1. The list of classes’ clusters with the corresponding metrics

Cluster Class Id CC EC LCOM

1.11, 3, 4, 5, 7, 10, 11,15, 16, 17,19, 21, 23, 24, 25, 26, 27, 28, 30, 31

medium medium high

1.2 2, 6, 9, 12, 20, 29 small small small2 8, 13, 14, 32, 18, 22 high high high

2.4. Proposed Refactorings and their impact. In this paper, our studyrefers to ”Split Method” refactoring method. The metrics values obtainedbefore and after applying this refactoring are compared.

3. Case Study

Two case studies were proposed in order to validate our metric-based ap-proach of identifying “God classes”. This short version presents only one ofthe cases. The analyzed .NET project consists of 32 classes. In what followswe present the results obtained after applying the steps described in Section2.The selected metrics (Section 2.2) were computed using NDepend [8] tool.After applying the Fuzzy Divisive Hierarchic Clustering (FDHC) algorithm [3]we have obtained the clusters briefly described in Table 1. The value of theDFE metric is 1.33, the minimum value being 0.4 and the maximum value1.58, the obtained value suggesting that the “God class” design flaw is largelystudded into the software system.

The analysis of the metric’s values from each cluster reveals the clusterwith “problems” regarding the “God Class” design flaw: in the first cluster,i.e. 1.1 the CC metric and EC metric have “good” values, but the LCOM valueindicate a poorly cohesive class, for the 1.2 cluster all the metric values are“good”, indicating that the classes from this cluster are not candidates for the“God Class’ design flaw, but the elements from the cluster 2 have the value forthe Cyclomatic Complexity metric greater than 30 (being extremely complex),EC metric is high and the COM very closed to 1, indicating poorly cohesiveclass and have more than one responsibility. Thus, the classes from the 2cluster are candidates for “God Class” design flaw, being proposed for refac-toring.Extract Method was applied for 3 classes of this cluster, DataServer,IM and InvForm, respectively 7 methods, and the complexity of some meth-ods/classes was reduced. See Table 2 for more details.

4. Conclusion

The current paper proposes a new metric based approach to evaluate theimpact of applied refactoring on software desing. For future work, we intend

Page 30: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

28 SIMONA MOTOGNA, CAMELIA SERBAN, AND ANDREEA VESCAN

Table 2. Metrics values before and after applying refactoringfor the analyzed classes.

Before AfterClass CC EC LCOM CC EC LCOM

DataServer 37 28 0.86 35 28 0.64

IM 59 43 0.96 44 43 0.91

InvForm 52 67 0.94 51 67 0.94

to focus our research in the following directions: to apply the proposed eval-uation framework on more refactoring methods and to automate the task ofestablishing the list of suspect entities and the list of refactorings that couldbe applied.

References

[1] R. Marinescu: Measurement and quality in object-oriented design, Ph.D. thesis inthe Faculty of Automatics and Computer Science of the Politehnica University ofTimisoara, 2003.

[2] Camelia Serban, A Conceptual Framework for Object-oriented Design Assessment,Computer Modeling and Simulation, UKSim Fourth European Modelling Symposiumon Computer Modelling and Simulation, 90–95, 2010.

[3] Dumitrescu, D., Hierarchical pattern classification, Fuzzy Sets and Systems 28, 145–162, 1988.

[4] A.J. Riel. Object-Oriented Design Heuristics, Addison-Wesley, 1996.[5] M. Salehie and Li Shimin and L. Tahvildari A Metric-Based Heuristic Framework to

Detect Object-Oriented Design Flaws, Program Comprehension, 2006.[6] M. Fowler and K. Beck and J. Brant and W. Opdyke and and D. Roberts: Refactoring:

Improving the Design of Existing Code, Addison-Wesley, 1999.[7] C. Serban and A. Vescan and H.F. Pop Design Flaw Entropy metric for software quality

assessment, Computer Science - Research and Development (submitted)[8] NDepend, NDepend, http://www.ndepend.com/, 2015.

(1) Computer Science Department, Faculty of Mathematics and ComputerScience, Babes-Bolyai University, Cluj-Napoca, Romania

E-mail address: [email protected]

E-mail address: [email protected]

E-mail address: [email protected]

Page 31: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 29–32

COMPARING C# AND JAVA EXTENSION METHODS IN

THE CONTEXT OF IMPLEMENTING MIXDECORATOR

VIRGINIA NICULESCU

Abstract. Decorator design pattern is a very well-known pattern thatallows additional functionality to be attached to an object dynamically.MixDecorator is an enhanced variant of the Decorator, which does not justeliminate some constraints of the original one, but also allows it to beused as a base for a general extension mechanism. Using it, we may com-bine different responsibilities and operate with them directly and simul-taneously. Its implementations in two of the most important mainstreamobject-oriented languages: Java and C# are compared. This also representa starting point for a comparison analysis between C# extension methodsand Java default methods, or virtual extension methods as they are alsocalled.

1. Introduction

The classical Decorator pattern offers a solution to extend the function-ality of an object in order to modify its behavior. It is usually agreed thatdecorators and the original class object share a common set of operations:multiple decorators can be stacked on top of each other, each time adding anew functionality to the overridden method(s). Still, when we want to addnew responsibilities, and not just to change the behavior of an existing one,the classical Decorator pattern allows us to define such a decoration, but this isaccessible only if it is the last added one. MixDecorator does not just eliminatesome constraints of the classical pattern (e.g. limitation to one interface), butalso allows it to be used as a base for a general extension mechanism. Usingit, we may combine different responsibilities, and have direct access to all.

As a possible usage scenario we may consider that we have n responsi-bilities intended to be defined as decorations for a base class ComponentBase.

2010 Mathematics Subject Classification. 68P05.1998 CR Categories and Descriptors. D.1.5 Object-oriented Programming D.3.3Language

Constructs and FeaturesPatterns D.3.3Language Constructs and Features .Key words and phrases. object-orientation, patterns, decorator, responsibilities, lan-

guages, Java, C#.

c©2015 Babes-Bolyai University, Cluj-Napoca

29

Page 32: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

30 VIRGINIA NICULESCU

Figure 1. The class diagram for the MixDecorator pattern.

These responsibilities are defined as methods – R1, R2, ..., Rn. As the pat-tern specifies, n decorator classes will be defined (D1, D2 . . . Dn), each definingthe corresponding method, and they are all derived from a decoration classDecoratedBase, which is on turn derived from ComponentBase. Theoretically,we may obtain any combination of decorations but we have only the base classinterface available.

2. MixDecorator

By using MixDecorator we are able to attach a set of additional respon-sibilities to an object dynamically, and to allow the access to the all addedresponsibilities. It provides a flexible alternative to subclassing for extendingobjects functionality and their types also (extending the set of messages thatcould be sent to them) [3].

The solution of the MixDecorated is inspired by the Decorator but thereare several important differences. As for simple decorators we enclose thesubject in another object, the decorator object, but the decorator could havean interface that extends the base interface.

The structure is presented in Figure 1. The concrete class DecorateBase

has almost the same definition as the corresponding class from the classicalDecorator (the difference is the additional method getBase().

For a particular application, after the new responsibilities are inventoried,then particular My IDecorator interface and My DecoratorBase class are defined.My IDecorator defines the methods that correspond to all new responsibilities.

2.1. Java Implementation. We will give some implementation details inJava 8, based on default methods in interfaces. The primary intent of this

Page 33: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

COMPARING C# AND JAVA EXTENSION METHODS 31

feature was to allow interfaces to be extended over time preserving back-ward compatibility. Implicitly, interfaces provide multiple type-inheritance, incontrast to class-inheritance. Java 8 interfaces introduce a form of multipleimplementation inheritance, too.

public interface My_IDecorator extends IDecorator{

default void f1() throws UnsupportedFunctionalityException{

throw new UnsupportedFunctionalityException("f1");}

. . .

}public class My_DecoratorBase extends DecoratorBase

implements My_IDecorator {

public My_DecoratorBase(ComponentBase base){ super(base); }

public void f1() throws UnsupportedFunctionalityException{

ComponentBase base = getBase();

try{ ((My_IDecorator)base).f1(); }

catch (ClassCastException e){ My_IDecorator.super.f1(); }

. . .

}The structure of the pattern as emphasized in Figure 1 requires multiple

inheritance or a surrogate of this - as the Java 8 Extended interfaces provide[6]. This is also a very good example of their usability. A language as C++ orany other that allows multiple inheritance could be used for implementation.In these cases My IDecorator could be defined as an abstract class.

Extensions with other responsibilities. If in time other possible responsibilitiesare discovered as being appropriate to be used in collaboration with thosewhich were previously defined, these could be added using the following steps:

(1) Define a new interface – MyExt IDecorator that extends My IDecorator

interface, and defines the desired new responsibilities.(2) Define a class – MyExt DecoratorBase that extends My DecoratorBase

and implements MyExt IDecorator.(3) (optional) Adapt – using class Adapter pattern – the previous decora-

tion classes to the new defined interface. For example the class DF2 Ext

is derived from DF2 and implements MyExt IDecorator; no method over-riding is necessary.

2.2. C# Implementation. In C# we have a mechanism called “extensionmethods” that allows adding new methods to a class after the complete def-inition of the class [5]. They allow the extension of an existing type withnew functionality, without having to sub-class or recompile the old type. Themechanism allows only static binding and so the methods that could be addedto a class cannot be declared virtual. In fact, an extension method is a staticmethod defined in a non-generic static class, and can be invoked using aninstance method syntax.

Page 34: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

32 VIRGINIA NICULESCU

Using them, we may simplify the structure of the MixDecorator by exclud-ing My IDecorator interface and My DecoratorBase class. They are replaced bya static class My Decorator where the methods f1(), f2(), f3() are definedas extension methods:public static class My_Decorator

{ public static void f1(this DecoratorBase db)

{ try { ((DF1)db).f1(); }

catch (InvalidCastException e)

{ try { ((DecoratorBase)db.getBase()).f1(); }

catch (InvalidCastException ee)

{ throw new UnSupportedFunctionalityException("f1");}}}

... }

The code defines a recursion that it’s stopped either if the current(top)decoration defines the invoked method or by throwing an exception if no dec-oration that defines such a method was found. In Java the verification of thefirst case is implicitely done based on polymorphic call.

For defining decoration extension in C# it is enough to define a new staticclass MyExt Decorator that similarly defines the method f ext() – the interfaceMyExt IDecorator and the class MyExt DecoratorBase are no longer necessary.By defining them, any combination of decorators could be used on top of theothers, and all the responsibilities are directly accessible.

3. Conclusions

Two implementations of MixDecorator pattern – in Java and C# – wereanalyzed, and this analysis emphasizes the differences and also the advantagesand disadvantages of Java extended interfaces and C# extension methods.

References

[1] V.Bono, E. Mensa, M. Naddeo. Trait-oriented Programming in Java 8. PPPJ’14: Inter-national Conference on Principles and Practices of Programming on the Java Platforms.,Sep 2014, Cracow, Poland.

[2] E. Gamma, R. Helm, R. Johnson, J. Vlissides: Design Patterns: Elements of ReusableObject Oriented Software, Addison-Wesley, 1994.

[3] V. Niculescu MixDecorator: An Enhanced Version of Decorator Pattern submitted toEuroPlop’15.

[4] A. Shalloway, J. R. Trott. Design Patterns Explained: A New Perspective on Object-Oriented Design. Addison Wesley, 2004

[5] Extension Methods (C# Programming Guide) https://msdn.microsoft.com/en-us//library/bb383977.aspx

[6] Java SE 8: Implementing Default Methods in Interfaceshttp://www.oracle.com/webfolder/technetwork/tutorials/obe/java/JavaSE8DefaultMethods/JavaSE8DefaultMethods.html

Department of Computer Science, Babes-Bolyai University, Cluj-NapocaE-mail address: [email protected]

Page 35: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 33–36

PARALLEL TRACKING AND MAPPING WITH SURFACE

DETECTION FOR AUGMENTED REALITY

ALEXANDRU MORARU (1), ADRIAN STERCA (1), AND RARES BOIAN (1)

Abstract. This extended abstract outlines a PTAM (Parallel Trackingand Mapping algorithm with planar surface detection suitable for augu-mented reality applications in small workspaces.

1. Introduction and Related Work

Simultaneous Localization and Mapping (SLAM) is the process throughwhich a mobile robot builds a map of the surrounding environment and atthe same time it tracks its movement through this environment map [1]. Therobot uses odometry data to estimate its position and sensor data to extractlandmarks from the environment, landmarks which will form the map of theenvironment. Examples of sensors which can be used for landmark extractionand mapping are laser scanners, sonars and, more recently, video cameras.Formulated mathematically, the SLAM problem implies computing the prob-ability distribution P (Xk,m|Z0:k, X0:k−1) for each time k where Xk is thelocation of the robot at time k, m is the map (i.e. the set of locations ofall landmarks observed so far), Z0:k is the set of all landmark observations intime interval [0, k] and X0:k−1 is the set estimated locations of the robot intime interval [0, k − 1]. The algorithm for solving the SLAM problem usu-ally has an iterative form and at each step the new position of the robot isestimated based on a motion model, then observations are gathered from thesensors and the new position is updated. Many SLAM solving algorithms useExtended Kalman Filters [2] or particle filters [4]. Recently, SLAM algorithmswere proposed for augmented reality applications [3]. These algorithms use ahand-held camera or the video camera of a smart phone for getting sensor data

Received by the editors: ...2010 Mathematics Subject Classification. code, code.1998 CR Categories and Descriptors. code [Topic]: Subtopic – Detail ; code [Topic]:

Subtopic – Detail .Key words and phrases. parallel tracking and mapping, surface detection, augmented

reality.

c©2015 Babes-Bolyai University, Cluj-Napoca

33

Page 36: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

34 ALEXANDRU MORARU, ADRIAN STERCA, AND RARES BOIAN

from the environment. In PTAM [3] the localization and mapping processesare done approximately separately in two threads.

In this paper we propose a parallelized SLAM algorithm with surface de-tection used for building augmented reality applications for small workspaces.The augmented reality is projected on a planar surface of the environment.

2. System Architecture

The system uses a smart-phone running on Windows (which will be laterreferred to as the client) and a laptop running also on Windows (which will belater referred to as the server). The component running on the client has tworunning threads. On one of them, frames are captured from the video cameraand send to the server and the other thread waits for incoming positioningdata from the server; this positioning data tells the client application thenew, updated location of the video camera (relative to the previous location).The server component has a receiving thread and a processing thread. Thereceiving thread receives frames from the client components and pushes themin a queue, while the processing thread removes frames from the dequeue,updates the current location of the video camera and the map and then itsends this updated location to the component running on the smart-phone.

The client component was implemented as a hybrid project in C# andC++ whilst the server application is entirely written in C++. All the com-munication between the server and the client is done using TCP via an ad-hocwireless connection.

3. Tracking and Mapping

For the tracking part the application makes use of OpenCV 2.4.10 library.The algorithm requires two consecutive frames from which it detects and ex-tract keypoints (landmarks). The keypoints used are ORB (i.e. a combinationof FAST keypoint detector and BRIEF descriptor with some modifications).After the extraction, the algorithm uses a BruteForce Matcher to find simi-lar keypoints and from the results it computes the minimum and maximumdistance between two matching keypoints. Having these two values and animposed threshold of 3 * the minimum distance for two keypoints, a seriesof good matches is found. After this filtering, the algorithm computes thedisplacements (on the x- and y-axis) between the first and second image andcomputes the homography from the two sets of keypoints (one set for eachframe). From that, the algorithm calculates the surface of the first frametransposed into the second frame. The tracking algorithm is depicted in thefollowing listing:

f unc t i on FindDisplacement ( image1 , image2 ) {

Page 37: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

PARALLEL TRACKING AND MAPPING FOR AUGMENTED REALITY 35

keypointsImage1 = detec t ( image1 ) ;

keypointsImage2 = detec t ( image2 ) ;de sc r ip to r s Image1 = e x t r a c t ( image1 , keypointsImage1 ) ;de sc r ip to r s Image2 = e x t r a c t ( image2 , keypointsImage2 ) ;

matches = BFMatcher . match ( descr iptors Image1 , de sc r ip to r s Image1 ) ;FindMinAndMaxDistances ( matches , minDist , maxDist ) ;goodMatches = DetermineGoodMatches ( matches , minDist ) ;

<image1Points , image2Points> = GetImagesPoints ( goodMatches ) ;<displacementX , displacementY> =

ComputeDisplacement ( image1Points , image2Points ) ;

h = findHomography ( image1Points , image2Points ) ;q u a d r i l a t e r a l S u r f a c e = ComputeSurface (h ) ;

}

In order to compute the displacement on the z-axis (i.e. zoom in/out)we compute the surface of the quadrilateral resulted from transposing thefirst frame into the second one (obtained by the algorithm depicted above).The surface of this quadrilateral is computed by drawing one diagonal andcomputing the area of the two resulting triangle using Heron’s formula:

(1) Surface =√s ∗ (s− a) ∗ (s− b) ∗ (s− c),

where s is the semi-perimeter of the triangle, and a, b, c are its edges. Thetransposed image surface will be used to compute the displacement on thez-axis and to scale the elements from the virtual reality on the smart-phoneclient.

4. Surface Detection

The algorithm for surface detection relies on two consecutive frames re-ceived from the video camera. From these two frames, the algorithm computesa disparity map (i.e. 3D depth map) where the white pixels represents theclosest object to the camera and the black pixels the most distant object. Thealgorithm’s goal is to find a surface of continuous black pixels of a minimumarea. The algorithm for detecting the planar surface is described below:

f unc t i on FindSurface ( image ) {sur faceMatr ix = [ ] [ 2 ] ;l i n e = 10 ;pos = 0 ;while ( l i n e < image . he ight ){

<f i r s t I n d e x , nrBlackPixe l s> =

FindLongestContinuousSequenceBlackPixels ( image [ l i n e ] ) ;sur faceMatr ix . add ( f i r s t I n d e x , nrB lackPixe l s ) ;

pos = pos + 1 ;sk ip 10 l i n e s ;

}for i=0 to sur faceMatr ix . l ength − 1 {

for j=i+1 to sur faceMatr ix . l ength {l i n e P i x e l s = ComputeOverlappingSurface ( sur faceMatr ix , i , j ) ;

Page 38: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

36 ALEXANDRU MORARU, ADRIAN STERCA, AND RARES BOIAN

s u r f a c e L i n e P i x e l s = ComputeSurfaceLineMatrix ( l i n e P i x e l s ) ;

save the max s u r f a c e and the coo rd ina t e s ;}

}}

The function FindLongestContinuousSequenceBlackPixels searches for thelongest sequence of continuous black pixels on a given line in the disparitymap. The function does not verify every pixel for its color, it skips a segmentof pixels of fixed length (i.e. 5 pixels segment) in order to be computationalefficient. After the surfaceMatrix is constructed, the algorithm browses everyline of the matrix trying to find the sequence of overlapping lines that has thelargest surface. Not all overlapping lines will be taken into consideration, theoverlap area must be greater or equal to a given threshold.

5. Augmented Reality Rendering

As mentioned in the System Architecture, the client will receive updatedpositioning data from the server. The data consist of the displacement on x-and y-axis, the transposed surface, and the coordinates of the biggest planarsurface found from the first N frames sent. According to this data, the virtualreality object will be placed to the detected planar surface. For improving theuser experience, the virtual objects will not jump to a new position whenevernew data is received from the server, but they will continuously increase ordecrease their position with small values until they arrive at the new, correctlocation.

References

[1] H. Durrant-Whyte and T. Bailey, Simultaneous Localization and Mapping: Part I TheEssential Algorithms, IEEE Robotics & Automation Magazine 13 (2), 99-110, 2006.

[2] H. Durrant-Whyte and T. Bailey, Simultaneous Localization and Mapping(SLAM): PartII State of the Art, IEEE Robotics & Automation Magazine 13 (3), 108-117, 2006.

[3] G. Klein and D. Murray, Parallel Tracking and Mapping for Small AR Workspaces, InProc. International Symposium on Mixed and Augmented Reality, 2007.

[4] M. Montemerlo, S. Thrun, D. Koller, and B. Wegbreit, FastSLAM 2.0: An improvedparticle filtering algorithm for simultaneous localization and mapping that provably con-verges, In Proc. International Joint Conference on Artificial Intelligence, pages 11511156,2003.

(1) Babes-Bolyai University, Department of Computer Science, Cluj-NapocaE-mail address: [email protected]

E-mail address: [email protected]

E-mail address: [email protected]

Page 39: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

ARTIFICIAL INTELLIGENCE

Page 40: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis
Page 41: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 39–42

DECISION TREE BASED GENDER IDENTIFICATION IN

HUMAN REMAINS

IOAN-GABRIEL MIRCEA, GABRIELA CZIBULA AND MARA-RENATA PETRUSEL

Abstract. We are approaching in this paper, from a machine learningperspective, the problem of detecting the gender of human skeletal re-mains from bone measurements. The problem of sex identification of hu-man remains is of major importance for archaeologists, since it providesinformation regarding the characteristics of past societies. For predictingthe gender of human skeletons, an inductive learning method based ondecision trees will be used. Computational experiments are performed onpublicly available archaeological data sets. The obtained results empha-size the effectiveness of the proposed approach with respect to the similarapproaches existing in the literature.

1. Introduction

Detecting the gender of human skeletal remains is very important forstudying the gender differences in past populations [2]. This contributes toa better understanding of the social position and attributions of each genderin society. The sex identification task is a very delicate one and is highlyinfluenced by the historical period and the geographic origin of the skeleton.

We propose in this paper an approach based on an optimized ID3 decisiontree learning algorithm for solving the sex detection problem. Three casestudies will be used for evaluating the performance of our model. The obtainedresults emphasize that our approach overperforms an existing approach fromthe literature. As far as we know, an approach similar to ours has not beenreported in the literature.

The remainder of the paper is organized as follows. Section 2 introducesour approach for the detection of gender in human skeletons. Experimental

Received by the editors: April 4, 2015.2010 Mathematics Subject Classification. 68T05,68T10.1998 CR Categories and Descriptors. I.2.6 [Artificial Intelligence]: Learning – In-

duction; I.2.1 [Artificial Intelligence]: Applications and Expert Systems – Medicine andscience .

Key words and phrases. machine learning, decision tree, bioarchaeology.

c©2015 Babes-Bolyai University, Cluj-Napoca

39

Page 42: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

40 IOAN-GABRIEL MIRCEA, GABRIELA CZIBULA AND MARA-RENATA PETRUSEL

evaluations are given and a comparison to similar work from the literature ispresented in Section 3. Section 4 presents the conclusions of the paper andmentions future research directions.

2. Our approach

This section presents our approach on using decision trees for sex iden-tification in human remains from the length of long bones of the arm andleg. The first step in building our inductive learning models is the data pre-processing step. Since we are dealing with real-valued features (i.e the bonemeasurements are real values), the data is discretized. The discretization ideais the one indicated in [4] and presumes that a discrete-valued feature will bedefined dynamically to divide the continuous attribute value into a discreteset of intervals. In consequence, in our approach we selected two numericalvalues for discretizing each and every feature: 1, respectively 2.

After the data set is pre-processed as indicated above, the inductive learn-ing model will be built during the training step. The classification processtakes place in two phases that indicate the ideas of an inductive learning al-gorithm: training and testing. In the training phase the inductive model willbe built and further applied for classifying an unseen skeleton as part of thetesting phase. For building the decision tree (DT), an optimized variant ofthe ID3 algorithm [5] is used. When building the tree, an heuristic is used inorder to stop splitting a node in the tree if this spilt is considered to be unim-portant. Besides the heuristic described above, in order to avoid overfitting,a χ2 pruning is used with the scope of reducing the tree while it is built. Thisis a form of pre-pruning, in which the χ2 test [3] is applied to the data at aparticular node in the tree, in order to determine if the distribution of classesin the data is or not statistically significant.

After the inductive learning model was built as described above, a testingstep is performed to evaluate its performance. Two evaluation measures will befurther used to test the performance of the DT model: the accuracy (denotedby Acc) and the Area under the ROC curve measure (denoted by AUC).Good classifiers have high accuracy and AUC values. Thus, these measuresneed to be maximized in order to obtain better classifiers. For evaluating theperformance of the DT model, a leave-one out cross-validation was used.

3. Experimental evaluation

This section contains the experimental evaluation of the DT model (de-scribed in Section 2) considering three case studies which were performed ontwo data sets obtained from the literature [1]. The data set from [1] consistsof 200 male and 200 female skeletons from the Pretoria Bone and Raymond

Page 43: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

DECISION TREE BASED GENDER IDENTIFICATION IN HUMAN REMAINS 41

A. Dart collections. Ten anthropometric measurements were taken from theradius bone and nine measurements from the ulna bone.

The experiments are conducted as follows. We used information gain (IG)[4] based feature selection. In order to determine what features to eliminate,we sort all features in the descending order of their information gain. Then, weeliminate features one by one in increasing order of IG values. When buildingthe decision tree, two impurity functions are used. The first impurity functionis the entropy [4] and is commonly used in building decision trees. The secondimpurity function we are using is the misclassification function. For a set Sof instances (consisting of a males and b females), the misclassification of S

is computed as misclassification(S) =

{b

a+b if a > ba

a+b otherwiseThe first case study we are considering for evaluation consists of human

remains identified by ten radial measurements [1], whereas for the second casestudy nine measurements of the ulna bone were considered. As the thirdcase study we are using the data set which contains both the radial and ulnarmeasurements (the first ten features are the radial measurements and the nextnine features represent the ulnar measurements).

Table 1 presents the results obtained after the experiments performed onthe first case study using a decision tree constructed with χ2 pruning. For eachexperiment we depict the set of features which provided the best results, theimpurity function used for building the tree (Entropy and Misclassification)and the values obtained for the Acc and AUC evaluation measures using aleave-one-out cross-validation. We mention that for the third case study, thefeature set was considered as the union of features which have provided thebest results for the first two case studies. For each case study, the last columnindicates the average accuracy value that was obtained in the literature [1].

Case study Feature set Entropy Misclassification AverageAcc AUC Acc AUC accuracy [1]

First {4, 8, 2, 1} 0.860 0.860 0.855 0.855 0.838Second {4, 7, 1, 5, 3} 0.878 0.885 0.848 0.849 0.843Third {4, 8, 2, 1, 14, 0.885 0.886 0.873 0.873 -

17, 11, 15, 13}Table 1. Results obtained on the case studies considered for evaluation.

Based in the results presented in Table 1, one can see that the best values,for each case study, are obtained using the entropy impurity function. We alsonote that the best Acc and AUC values are obtained in the third case study.

There is only one approach in the literature that uses the same data setsas in our paper, a discriminant analysis method which was introduced in [1].

Page 44: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

42 IOAN-GABRIEL MIRCEA, GABRIELA CZIBULA AND MARA-RENATA PETRUSEL

Five discriminant functions were used in this paper for the data set we haveconsidered in our first case study and four functions were used for the dataset considered in our second case study. For estimating the performance ofthe gender prediction task, only the accuracy is reported in [1], thus we willalso use for comparison this evaluation measure. We note that [1] uses thesame evaluation method as in our paper, i.e “leave-one-out” cross-validation.From Table 1 we observe that our DT model is more performant that thediscriminant analysis method from [1]. A comparison of our approach toother existing approaches from the literature is hard to be made, since in theexisting approaches the experiments are performed on data sets which differfrom the one considered in this paper. Based on the experimental results wehave obtained, we can conclude that decision trees are machine learning modelswhich seem to offer accurate predictions for the gender detection problem.

4. Conclusions and further work

We have proposed in this paper an inductive learning method for detectingthe sex of human remains from bone measurements, which is based on decisiontrees. The experimental results obtained on three open-source data sets revealthat our approach outperforms a similar approach from the literature.

Further work will be done in order to extend the experimental evaluationof the proposed machine learning based model on real data sets to betterinvestigate their performance. We also plan to investigate the use of randomforests and fuzzy tree based models, as well as to further consider techniquesfor feature selection and for data discretization.

References

[1] Isabelle Linda Odile Barrier. Sex determination from the bones of the forearm in a modernSouth African sample. PhD thesis, Univeristy of Pretoria, 2007.

[2] M. Faerman, D. Filon, G. Kahila, C. L. Greenblatt, P. Smith, and A. Oppenheim. Sexidentification of archaeological human remains based on amplification of the X and Yamelogenin alleles. Gene, 167(1-2):327–32, 1995.

[3] Priscilla E. Greenwood and Michael S. Nikulin. A Guide to Chi-Squared Testing. WileySeries in Probabilities and Statistics. Wiley, 1996.

[4] Thomas M. Mitchell. Machine learning. McGraw-Hill, Inc. New York, USA, 1997.[5] J. Ross Quinlan. C4.5: Programs for Machine Learning. Morgan Kaufmann Publishers

Inc., San Francisco, CA, USA, 1993.

Department of Computer Science,, Faculty of Mathematics and ComputerScience,, Babes-Bolyai University, Kogalniceanu 1, Cluj-Napoca, 400084, Roma-nia.

E-mail address: {mircea, gabis}@cs.ubbcluj.ro, {pmir1335}@scs.ubbcluj.ro

Page 45: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 43–46

FACIAL LANDMARK BASED GAZE DIRECTION

ESTIMATION

ROBERT-ADRIAN RILL(1,2) AND ZOLTAN TOSER(1) AND ANDRAS LORINCZ(1)

Abstract. We address the problem of gaze direction estimation fromimages, possibly from low resolution ones. Our method is based on featuressubtracted from regions around eye landmarks. We utilize a novel 3Ddatabase, derive a 3D model fit to the 2D data. We present experimentalresults on the precision of the approach.

Gaze and eye contact express emotions, communicate interpersonal en-gagement, reveal cognitive processes, indicate focus of attention and objectsof interest, regulate social interaction and can reveal intentions, see, e.g., [7]and the references therein.

Automated gaze tracking has been the subject of extensive research fordiverse applications. The most common situation is that the user is seatedin front of the monitor and infrared light sources are used for the measure-ments (for a review, see, e.g., [6]). Novel technologies utilize wearable eyetracking glasses and there are at least four commercial products available onthe market. They are of high precision, exploit infrared light built into theglasses. However, gaze direction estimation in the absence of infrared lightand properly set cameras, e.g., from remote distances and especially underlow resolution conditions remains unsolved. This is a challenging problem anda relevant application oriented research direction for monitoring, identifyingand predicting social interactions in different environments.

Gaze estimation methods can be categorized into two main categories:

Model based estimation: uses 3D eyeball models and estimate gazedirection by means of geometric eye features [2, 1].

Appearance-based estimation: exploits non-geometric image featuresfrom input eye images. They consist of learning a mapping functionfrom the input eye image to the target gaze directions [3].

Received by the editors: April 15, 2015.2010 Mathematics Subject Classification. 68T10, 62G08, 68U10, 65F20.1998 CR Categories and Descriptors. I.5.4 [Pattern Recognition]: Applications – Com-

puter Vision; G.1.2 [Numerical Analysis]: Approximation – Least Squares Approximation.Key words and phrases. gaze direction, face and eye alignment, cascade regression.

c©2015 Babes-Bolyai University, Cluj-Napoca

43

Page 46: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

44 ROBERT-ADRIAN RILL AND ZOLTAN TOSER AND ANDRAS LORINCZ

(a) (b) (c)

Figure 1. (a) Example of face and eye tracking on the Helendataset2, (b) frontal projection from the MVG dataset withmanual landmarks and (c) illustration of the experiment.

1. Face alignment with cascade regression

In the last few years 2D shape alignment has reached a mature state withthe emergence of discriminative shape regression methods [11, 4]. These align-ment algorithms estimate the shape by means of a high dimensional vectorrepresenting facial landmark points. A novel method predicts the shape viaa cascade: it begins with an initial guess about shape and then progressivelyrefines that guess by regressing a shape increment step-by-step from a featurespace. The feature space can be either hand designed or can be learned fromthe data [11].

In [4] a novel framework based on gradient boosting is presented for learn-ing an ensemble of regression trees for face alignment. This method performsshape invariant feature selection by estimating the facial landmarks directlyfrom a sparse subset of pixel intensities, achieving state-of-the-art performancein both speed and accuracy.

In the present work dlib1 [5], an open source C++ library, that implementsthe novel framework above, was used for estimating facial landmarks.

2. Dataset

For eye alignment and gaze direction estimation we used the Multi-viewGaze (MVG) Dataset [9]. This consists of 8,000 textured 3D models of eye re-gions. Participants were asked to look at different visual targets on a monitor.The annotated gaze directions spanned approximately ±25 degrees horizon-tally and ±15 degrees vertically covering the range of natural gaze directions.

1For details visit: http://www.dlib.net/

Page 47: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

FACIAL LANDMARK BASED GAZE DIRECTION ESTIMATION 45

3. Methods

3.1. Estimating gaze direction. The gaze direction is given in the headcoordinate system in the form of spherical coordinates (azimuth angle: θ,polar angle: φ, and radius normalized to unit length). We estimated the gazeangles from features computed via facial and eye landmarks as follows:

(1) find face with face detector and then(2) estimate the 68-point landmarks of face shape and then(3) estimate 16-point eye shape and then(4) use eye features and estimate gaze.

3.2. Estimating facial landmarks. We used dlib’s default shape predictormodel trained on the ibug 300W dataset3 for the position estimation of the68-point facial landmarks. We used the 68-point shape for the estimation ofthe size and position of the bouding box of the 16-point shape (Fig. 1a).

3.3. Estimating eye landmarks. We selected 300 meshes from the MVGDataset, uniformly sampled from each subject. The frontal views were ren-dered and the 16 markers were manually labeled: 2 markers on the bridge ofthe nose, 6-6 markers on the contour of the eyes and 1-1 marker correspond-ing to the pupils (Fig. 1b). We used this manual annotation to train an eyelandmark estimator and to annotate the remaining 7,700 frontal projections.

3.4. Computing gaze angles. The input features for estimating the gazedirection are computed as follows. Given the mean shape of the training data,one can align an arbitrary shape to the mean shape by calculating the optimalsimilarity transform, which minimizes the distance between the two vectors.Then the features are given by the offset between the mean shape and theactual aligned shape. Finally a linear regression matrix is computed whichtransforms the shape offsets to the target gaze directions.

3.5. Experiment and results. To validate the gaze estimation method, wehave set up a recording environment with 5 participants. They were askedto look at specific targets on a 23” full HD LCD screen. A chin rest wasused to stabilize the head position located at 60 cm distance from the monitor(Fig. 1c). Participants faces were recorded with an HD 720p web-camera. Themonitor coordinates of their gazes were measured with Tobii EyeX [8].

Using the 300 manual annotations from the MVG dataset as training datathe method achieves 7◦ testing error on average, on the data from the experi-ment. Adding the remaining 7,700 projections to the inputs gives an angularerror of 5◦ on average. However, extending the training set with some of the

2http://www.ifp.illinois.edu/~vuongle2/helen/3http://ibug.doc.ic.ac.uk/resources/300-W/

Page 48: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

46 ROBERT-ADRIAN RILL AND ZOLTAN TOSER AND ANDRAS LORINCZ

data obtained from the experiments decreases the error significantly. The errordropped under 2◦ on average.

4. Conclusion

We presented an appearance based step-wise gaze direction estimationmethod, which may support numerous applications in social environmentsobserved remotely. The resulting 5◦ precision can serve distant observations.Otherwise, simple additional calibration with adaptive training [10] shouldimprove the precision of the method.

5. Acknowledgments

Thanks are due to Kinga Farago for annotating and for her help in datacollection. Research was supported by the European Union and co-financedby the European Social Fund (grant no. TAMOP 4.2.1./B-09/1/KMR-2010-0003) and by the EIT ICT Labs grant on CPS for Smart Factories.

References

[1] J. Chen and Q. Ji. Probabilistic gaze estimation without active personal calibration. InProc. Conf. on Comp. Vis. Pattern Recogn., pages 609–616, 2011.

[2] E. D. Guestrin and E. Eizenman. General theory of remote gaze estimation using thepupil center and corneal reflections. IEEE Tr. Biomed. Eng., 53(6):1124–1133, 2006.

[3] D. W. Hansen and Q. Ji. In the eye of the beholder: A survey of models for eyes andgaze. IEEE Tr. Pattern Anal. Machine Intel., 32(3):478–500, 2010.

[4] V. Kazemi and J. Sullivan. One millisecond face alignment with an ensemble of regres-sion trees. In Proc. Conf. on Comp. Vis. Pattern Recogn., pages 1867–1874, 2014.

[5] Davis E. King. Dlib-ml: A machine learning toolkit. Journal of Machine Learning Re-search, 10:1755–1758, 2009.

[6] Carlos H Morimoto and Marcio RM Mimica. Eye gaze tracking techniques for interactiveapplications. Comp. Vis. Image Understanding, 98(1):4–24, 2005.

[7] U. J. Pfeiffer, B. Timmermans, G. Bente, K. Vogeley, and L. Schilbach. A non-verbalturing test. PloS One, 6(11):e27591, 2011.

[8] Tobii Eye Tracking Research. Eye tracking products. 2014. http://www.tobii.com/.[9] Y. Sugano, Y. Matsushita, and Y. Sato. Learning-by-synthesis for appearance-based 3d

gaze estimation. In Proc. Conf. on Comp. Vis. Pattern Recogn., pages 1821–1828, 2014.[10] S. Hy Truong. Semi-supervised adaptive facial tracking method. National Scientific Stu-

dent Competition (OTDK), April 2015. 1st prize.[11] X. Xiong and F. De la Torre. Supervised descent method and its applications to face

alignment. In Proc. Conf. on Comp. Vis. Pattern Recogn., pages 532–539, 2013.

(1) Eotvos Lorand University, Egyetem ter 1-3, Budapest, 1053 Hungary

(2) Babes-Bolyai University, 1 M. Kogalniceanu St., Cluj-Napoca, 400084Romania

Page 49: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 47–50

ARCHAEOLOGICAL HEIGHT PREDICTION USING

SUPPORT VECTOR REGRESSION

VLAD-SEBASTIAN IONESCU (1)

Abstract. In this paper we apply Support Vector Machines to the prob-lem of predicting the height of human skeletons given bone measurements.There exist archaeological methods for estimating height, but our purposeis to investigate the potential of Support Vector Regression for this task.Since skeletal stature clearly depends on individual bone lengths, buildingSVM models for this task has the potential of giving an accurate machinelearning automation for this task, which can be useful for archaeologists.We investigate multiple kernels and compare our results to existing liter-ature results on the topic. Our experiments show that SVM regressionmodels are very good for this problem, outperforming existing approaches.

1. Introduction

A very important problem in archaeology and forensic science is the prob-lem of height estimation. Existing approaches that deal with this probleminvolve simple regression formulas based on statistical methods. We believethat the good performance of Support Vector Machines on other problems canmake them ideal for solving the problem of height estimation as well.

To the best of our knowledge, our approach is novel, since SVM modelshave not been used in the literature for height estimation until now. Ourobtained experimental results are significantly better than the existing onesin the literature and prove the ability of machine learning models and SVMsin particular to solve this problem.

Received by the editors: ...2010 Mathematics Subject Classification. 68T05, 68T01.1998 CR Categories and Descriptors. I.2.6 [Artificial Intelligence]: Learning – Concept

learning ; I.2.7 [Artificial Intelligence]: Learning – Induction.Key words and phrases. height estimation, regression, support vector machines, archae-

ology, forensic science.

c©2015 Babes-Bolyai University, Cluj-Napoca

47

Page 50: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

48 VLAD-SEBASTIAN IONESCU

2. The height prediction problem

According to [?, ?], height estimation is a central part of anthropologicalanalysis. A milestone approach is introduced in [?], along with the open sourcedata sets we use in this article. A variety of approaches exist for this problem,which proves its importance.

A comprehensive literature review on this topic can be consulted in [?].We have previously introduced two novel machine learning models based onartificial neural networks and genetic algorithms for the problem approachedin this paper [?].

3. Experimental setup and methodology

In this section, we describe the software libraries and testing methods usedfor running our experiments.

3.1. Software libraries and experimental methods. All of our experi-ments are performed using the scikit-learn machine learning library [?].

We run experiments using the linear, RBF (Radial Basis Function), poly-nomial and sigmoid kernels. We use a randomized grid search to tune thehyperparameters for our SVM model. We use 10 fold cross validation as themodel evaluation method within the random search. The parameter configura-tion that gives the best results, according to the Mean Absolute Error (MAE),is returned after 1000 random parameter samplings from uniform distributionsthat we deemed appropriate for each parameter. For the polynomial kernel,the grid searches found d = 1, which basically considers a linear kernel, so wedo not include it in the presentation.

We also normalized our data by mean subtraction and division by thestandard deviation.

For finding the optimal hyperparameters, we have added the normalizationstep as the first step of a pipeline, with the second and final step being theSupport Vector Regressor. Our normalizer only scales features. The resultingpipeline is then used as the final regressor given to the randomized search foroptimization.

3.2. Testing method. For each kernel, we use a single run of 10 fold crossvalidation per iteration, storing and using the hyperparameters that definethe model which minimizes the Mean Absolute Error score (MAE) over alliterations. That model is then used to report the MAE and Standard Errorof the Estimate (SEE) according to their classic definitions.

A 95% confidence interval for the mean on the 10 test folds is also reported,as described in [?].

Page 51: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

ARCHAEOLOGICAL HEIGHT PREDICTION USING SVR 49

Kernel MAE (cm) SEE (cm) Hyperparameterslinear 0.046±0.010 0.056±0.011 C = 91.92, ε = 0.07

RBF 0.088±0.061 0.101±0.068 C = 9625.77, ε = 0.07, γ = 0.004

sigmoid 0.881±0.504 0.913±0.504C = 4.064, ε = 0.114,

γ = 0.0162, r = 0.164

Table 1. Results obtained on the Caucasian case study. 95%confidence intervals are used for the results.

Kernel MAE (cm) SEE (cm) Hyperparameterslinear 0.031±0.008 0.041±0.017 C = 28.41, ε = 0.017

RBF 0.107±0.097 0.141±0.131 C = 7304.752, ε = 0.037, γ = 0.020

sigmoid 0.268±0.099 0.339±0.171C = 9.844, ε = 0.013,

γ = 0.0062, r = 0.479

Table 2. Results obtained on the African-american casestudy. 95% confidence intervals are used for the results.

4. Data sets and experimental results

In this section we present the experimental evaluation of the SVM modelon two case studies, following the process described in Section 3.

4.1. Data sets. Our data set is open source and taken from [?]. It consistsof two case studies, both in the same format and containing seven featuresrelated to skeletal bone measurements in centimeters and the skeleton gen-der: humerus, radius, ulna, femur, tibia, fibula, femur+tibia lengths and thegender. For each of the bones, the measurement represents the length of thelongest of the two bones. Each of the two case studies contains 92 instances:the first one contains measurements of caucasians and the second one mea-surements of afro-americans (47 males and 45 females in each).

4.2. Experimental results. Table 1 presents results for the first case study.For the Caucasian case study, the linear kernel proved to be the best.We note that all three kernels give very good results, considering that the

errors are in centimeters.Table 2 presents results for the second case study.Once more, the linear kernel is the best. Compared to the first case study’s

results, scores are better with the linear and sigmoid kernels and worse with theRBF kernel, although the differences are very small for any practical concerns.

Page 52: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

50 VLAD-SEBASTIAN IONESCU

Overall, results are worse on the second case study than on the first, butnot in a significant fashion.

4.3. Comparison to related work. Our results outperform existing litera-ture results. As far as we are aware of, only [?] presents results on these datasets. Their obtained SEE errors are between 3.05 and 3.66 cm. Our worstresult is 0.913 SEE on the second case study using the sigmoid kernel.

Therefore, our Support Vector Regression approach is a very reliable solu-tion to the problem of skeletal height estimation given the lengths of certainbones, leading to much better results than previous approaches.

5. Conclusions

We have introduced in this paper an SVM regression method for estimatingthe height of archaeological remains. We have run extensive experiments ontwo archaeological data sets that are freely available, obtaining very goodresults that surpass previous results from the literature.

Therefore, we consider our methods to offer significant contributions to thefields of archaeology and forensic analysis and believe that they will generalizewell to other problems of a similar nature.

References

(1) Department of Computer Science, Babes-Bolyai University, 1 M. KogalniceanuStreet, 400084, Cluj-Napoca, Romania

E-mail address: [email protected]

Page 53: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 51–54

FACIAL EMOTION DETECTION SYSTEM USING

MICROSOFT KINECT

PANA ALINA(1) AND SZABO ILDIKO(1)

Abstract. Affective Computing (AC) is a new field that brings togetherresearchers from different fields: psychology, neuroscience, cognitive psy-chology and nonetheless computer science. Emotion Recognition is animportant step in developing Human-Computer Interaction systems in-volved in gaming, customer services, Ambient Intelligence and many oth-ers. We propose an unimodal emotion recognition system based on facialexpressions using Kinect features for face detection and a rule based pro-gramming approach for identifying seven emotions: sadness, anger, fear,disgust, contempt, surprise and happiness.

Combining computers with emotions appeared under the name of AffectiveComputing and has its origins in 1995 in Rosalind Picards paper having thesame name [1]. This new branch has two directions: emotion recognition andemotion simulation. In the current research we are going to focus only onthe first one. From the perspective of Human-Computer Interaction, emotionrecognition has many applications represented by: building e-learning systems,introducing Ambient Intelligence products in peoples life and also developingmachines with emotional abilities.

In this article we present a method to recognize the seven basic emotionson the face, using automated computer software, named EmotionDetector.These basic emotions can be considered universal for all races, according tothe article written by the famous psychologist Ekman [2]. It was also he, whodefined the seven basic emotions as follows: anger, contempt, fear, disgust,happiness, sadness and surprise. The universality of the emotions ensuresthat the recognition software will be possible to apply in systems worldwide.

Received by the editors: 2015.04.26.2010 Mathematics Subject Classification. 68T01, 68N01.1998 CR Categories and Descriptors. J.3. [Life and medical sciences]: Subtopic –

Cognitive psychology ; J.4. [Social and behavioral sciences]: Subtopic – Psychology ;D.2.2. [Software engineering]: Subtopic – Design Tools and techniques User interfaces;

Key words and phrases. Facial expression, Emotion recognition, Affective computing,Kinect.

c©2015 Babes-Bolyai University, Cluj-Napoca

51

Page 54: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

52 PANA ALINA(1) AND SZABO ILDIKO(1)

The first part of this study explains face detection mechanism using Kinectfor Windows v2 and the process of extracting facial feature points. The secondpart is in fact the analysis on the extracted points using a rule based approachto classify the basic emotions. This is relevant because the results can beused for other researches and the application can be extended to recognizesecondary emotions as well or can be integrated in a multimodal emotionrecognition system.

1. Related work

The study of emotion recognition have been present in the field of com-puter science for some a significant period. There have been introduced non-automated and automated tools as well, which assist in or perform by them-selves the emotion recognition process.

The company Ekman Group, founded by Paul Ekman, created a tool,named Micro Expression Training Tool (METT) [3], which can help in trainingany individual in recognizing various facial expressions. METT is mainlyspecialized in presenting micro-expressions and it is used also in the trainingof police forces. It is designed to work with a large set of images showingvarious emotions and the user has to select the correct emotion. The subtletyof the system lies in the short period in which the emotion is shown (thisis why it is called micro-expression). Its success is due to its simplicity andeffectiveness. By using this tool ones ability of recognizing emotions can begreatly enhanced.

This tool, as well as many studies, rely on Facial Action Coding System,a measurement tool for face movements developed by Paul Ekman and WallyFriesen [4]. The system is based on Action Units which represent movementsof the brows, eye, nose and lips. There are approximately 45 action units ofthe face muscles.

2. Methodology

The basic structure of an Emotion Recognition System consists of face de-tection, feature extraction and classification. In our case the first step is doneusing Microsoft Kinect and the helper software Reflecta. Feature extractionis done by computing distances between relevant points on the face. Finally,for classification we used a rule based approach. Each step is important andhas to be processed in this specific order. (See Figure 1)

In order to map this process to our application we have the followingstages: detect facial points on .NET platform, export them to a JavascriptSimple Object Notation file, read the actual points on Java, compute distances

Page 55: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

FACIAL EMOTION DETECTION SYSTEM USING MICROSOFT KINECT 53

Figure 1. Data flow

between points and apply rule based programming on the distances in orderto determine the seven basic emotions.

2.1. Face tracking. For user face tracking we used Kinect for Windows v2.The sensor has the same build-in color camera, infrared (IR) emitter andmicrophone array, and it has improved at visualizing object more clearly.

2.2. Face detection. The face detection step was done using Reflecta frame-work for motion capture. The data detected by Kinect is sent to a .NET formapplication which applies a noise reduction algorithm and saves the data intoa .mocap file. The data is encoded using protocol buffers and is divided inface and body information. Facial detection is represented by 1347 3D points.

2.3. Feature extraction. For feature extraction we decided to use only themost relevant points that determine the following areas: eyebrows, eyes, me-dian line and mouth. These areas were chosen based on how often they changefrom one emotion to another. Hence, we collected for one frame:

• 16 points for the eyes (8 points for each eye)• 6 points for the eyebrows (3 points for each eyebrow)• 4 points for the median line• 8 points for the mouth

2.4. EmotionDetector. The model consists of the elements of the face (Eye,Eyebrow, Mouth, Medianline). The view shows the points retrieved from theKinect and output the detected emotion. The controller mediates between theview and the model.

To the MVC structure, a rule engine is added, also. The system is usingJess for defining rules for deciding between emotions. Jess is a rule engine forJava platforms and can be easily integrated into projects. It uses an enhancedversion of the Rete algorithm to process the rules and can reason about Javaobjects directly.

Using the Jess engine the rules will be constructed based on these differ-ences translated as the difference between the position of the points at neutralposition and the position changed by the emotion. First, using a set of test

Page 56: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

54 PANA ALINA(1) AND SZABO ILDIKO(1)

Figure 2. Emotions

frames the system will measure an initial distance between the points. (SeeFigure 2, taken from [5]). ) Then, correspondingly to each emotion and thedistance measured the system will have an initial set of standard distances.After that, the emotion will be detected if the distance is the same or in a 10%range of it. The emotion deduced in this way will be presented for the user.

3. Conclusions

The use of emotion detection is becoming more important for todays soft-ware as the technology in use advances. EmotionDetector offers a viable solu-tion for this problem by using the latest face recognition and motion detectionsoftware offered by Microsoft Kinect. Furthermore, it detects the emotionsusing an efficient inference rule engine named Jess based on a set of rules de-fined for 32 face points. Moreover, it uses neural network for training the facedetection algorithm. Another benefit, besides emotion recognition, is the useof an avatar in the projected view, not the person’s face, which has impor-tant psychological impact. It is also offers real-time face tracking and instantfeedback, making EmotionDetector an useful tool for different purposes.

References

[1] Rosalind Picard Affective Computing MIT Press, 1995[2] P. Ekman Strong evidence for universals in facial expressions Psychol. Bull., 115(2):

268287, 1994.[3] P. Ekman Become versed in reading faces Entrepreneur, March 25. 2009[4] P. Ekman, W. Friesen Facial Action Coding System: Investigators Guide Consulting

Psychologist Press, 1978[5] M. A. Puica Towards a computational model of emotions for enhanced agent performance

77-106, unpublished

(1) Babes-Bolyai University, Faculty of Mathematics and Computer ScienceE-mail address: [email protected], [email protected]

Page 57: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 55–58

SELF-ORGANIZING MAPS FOR IDENTIFYING SOFTWARE

DEFECTS

ZSUZSANNA MARIAN, ISTVAN GERGELY CZIBULA, GABRIELA CZIBULA ANDSERGIU SOTOC

Abstract. This paper addresses the problem of software defect detection,an important problem which helps to improve the software systems’ main-tainability and evolution. In order to detect defective entities within asoftware system, a self-organizing feature map is proposed. The trainedmap will be able to identify, using unsupervised learning, if a softwaremodule is defective or not. We experimentally evaluate our approach onthree open-source case studies, also providing a comparison with similarexisting approaches. The obtained results emphasize the effectiveness ofusing self-organizing maps for software defect detection.

1. Introduction

In order to increase the efficiency of quality assurance, defect detectiontries to identify those modules of a software where errors are present. In manycases there is no time to thoroughly test each module of the software system,and in these cases defect detection methods can help by suggesting whichmodules should be focused on during testing.

We are proposing in this paper an unsupervised machine learning methodbased on self-organizing maps for detecting defective entities within softwaresystems. The self-organizing map architecture was previously applied in theliterature for defect detection, but using a kind of hybrid approach, wheredifferent threshold values for some software metrics were also used [1]. Toour knowledge, there is no approach in the search-based software engineeringliterature similar to ours. The unsupervised model introduced in this paper

Received by the editors: April, 26, 2015.2010 Mathematics Subject Classification. 68T05, 62H30.1998 CR Categories and Descriptors. I.2.6[Computing Methodologies]: Artificial In-

telligence – Learning ; I.5.3 [Computing Methodologies]: Pattern Recognition – Cluster-ing .

Key words and phrases. software defect detection, machine learning, self-organizing map.

c©2015 Babes-Bolyai University, Cluj-Napoca

55

Page 58: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

56 ZS. MARIAN, I. G. CZIBULA, G. CZIBULA, S. SOTOC

proved to outperform most of the similar existing approaches, considering thedata sets used for evaluation.

2. Methodology

The main idea of this approach is to represent an entity (class, module,method, function) of a software system as a multidimensional vector, whoseelements are the values of different software metrics applied to the given entity.For each software entity, the label of the instance (defect or non-defect) isknown. We mention that the labels will be used only in the pre-processingstep and for evaluating the performance of the model. The first step beforeapplying the SOM approach is the data pre-processing step. During this step,the input data is scaled to [0,1] using the Min-Max normalization method, andthen a feature selection step will be applied (see Section 3). For the trainingstep, the Euclidean Distance and a torus topology for the SOM will be used.

For evaluating the performance of the SOM model, we are using severalevaluation measures from the supervised classification literature. Since thetraining instances were labeled, the labels are used to compute the confusionmatrix for the two possible outcomes. Considering the values computed fromthe confusion matrix, the following measures will be used in this paper: FalsePositive Rate (FPR), False Negative Rate (FNR) and Overall Error (OE).

3. Experimental evaluation

In this section we provide an experimental evaluation of the SOM modelon three case studies which were conducted on open source data sets. Wemention that we have used our own implementation for SOM, without usingany third party libraries. We have used three openly available data sets forthe experimental evaluation of our model, called Ar3, Ar4 and Ar5, which canbe downloaded from [4]. For the SOM used in the experiments, the followingparameter setting was used: the number of training epochs was set to 100000,the learning coefficient was set to 0.7, the radius was computed as half of themaximum distance between the neurons and the neighborhood function.

3.1. Data pre-processing. In order to analyze the importance of the fea-tures, we are using the information gain measure. For a better data analysis,we have computed the information gain of the features from the data set ob-tained using all three data sets (Ar3, Ar4 and Ar5 ) together. Starting fromthe IG values of the software metrics, we have chosen a threshold value τ andconsidered only the attributes whose IG was higher than this threshold. Outof these attributes, we selected those that measure different characteristics of

Page 59: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

SELF-ORGANIZING MAPS FOR IDENTIFYING SOFTWARE DEFECTS 57

the software system. For the threshold τ we have selected the value 0.163, be-cause we have achieved the best results with this value. Out of the 18 softwaremetrics we have selected 9 metrics whose IG value was higher than τ .

3.2. Results. We are presenting in the following the results we have obtainedby applying the SOM model on the Ar3, Ar4 and Ar5 data sets. For each dataset considered for evaluation, the experiments are conducted as follows. First,the data pre-processing step is applied and then the methodology indicatedin Section 2 is used for an unsupervised construction of a torus SOM. The U-Matrix corresponding to the trained SOM will be visualized (the red labels onthe U-Matrix represent the defective entities and the yellow labels representthe non-defective ones). Then, the evaluation measures presented in Section 2will be computed for evaluating the performance of the obtained results. Theresults we have obtained on the data sets considered for evaluation are givenin the first row of the Table 1.

4. Discussion and comparison to related work

Our approach was capable of separating the defective and non-defectiveentities in two clusters, obtaining a good topological mapping of the inputinstances. Even if the separation was not perfect, because in all three data setswe had both false positive and false negative entities. A major advantage of theself-organizing map is that it does not require supervision and any assumptionsabout the distribution of the input data. Thus, it may find unexpected hiddenstructures from the data being investigated. It is interesting that the SOM isable to detect, within the defective/non-defective class, subclasses of instances.This would be very useful, from a data mining perspective, since it may provideuseful knowledge for the software developers.

Considering the subclasses identified within the clusters for the defectiveand non-defective entities as further work we propose to analyze these sub-classes to identify the characteristics of the software entities placed in them.

Table 1 presents the values of the performance measures computed for theresults of our approach, but it also contains values reported in the literature forsome existing approaches. The Hyper Quad Tree-based approach presentedin [6] does not report FNR values, this is marked with “NR” in the table.

From Table 1 we can see, that even if our approach does not provide thebest results in each case, it has better results than most of the approaches. Outof 51 cases in total, our algorithm has a better or equal value for a performancemeasure in 43 cases, which represents 84.3% of the cases.

Page 60: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

58 ZS. MARIAN, I. G. CZIBULA, G. CZIBULA, S. SOTOC

Ar3 Ar4 Ar5

Approach FPR FNR OE FPR FNR OE FPR FNR OE

Our SOM 0.0182 0.25 0.0476 0.0230 0.5 0.1121 0.0357 0.125 0.0556

SOM and 0 0.25 0.0556 0.1034 0 0.0938 0.0714 0.25 0.1111threshold [1]

K-means - 0.3454 0.25 0.3333 0.0459 0.45 0.1214 0.1428 0.125 0.1388QT [2]

K-means - 0.0263 NR 0.0263 0.1875 NR 0.1846 0.0246 NR 0.0246Hyper QT [6]

XMeans [3] 0.3455 0.25 0.3333 0.4483 0.05 0.3738 0.1429 0.125 0.1389

XMeans [5] 0.0727 0.25 0.0952 0.023 0.6 0.1308 0.149 0.125 0.1389

EM [5] 0.1091 0.25 0.127 0.023 0.6 0.1308 0.149 0.25 0.1667

Table 1. Comparative results.

5. Conclusions and future work

We have introduced in this paper a self-organizing feature map which maybe used for an unsupervised detection of software defects. The experimentalresults obtained on three open-source data sets reveal a good performance ofthe proposed approach, it provides better results than many of the existingapproaches report in the literature. Future work will be done in order toextend the evaluation of the proposed machine learning based model on otheropen source case studies and real software systems. We will also investigatethe applicability of fuzzy self-organizing maps for software defect detection.

References

[1] G. Abaei, Z. Rezaei, and A. Selamat. Fault prediction by utilizing self-organizing mapand threshold. In 2013 IEEE International Conference on Control System, Computingand Engineering (ICCSCE), pages 465–470, Nov 2013.

[2] P.S. Bishnu and V. Bhattacherjee. Software fault prediction using quad tree-based k-means clustering algorithm. IEEE TKDE journal, 24(6):1146–1150, 2012.

[3] C. Catal, U. Sevim, and B. Diri. Software fault prediction of unlabeled program modules.In Proceedings of the World Congress on Engineering (WCE), pages 212–217, Dec 2009.

[4] Tera-promise repository. http://openscience.us/repo/.[5] Mikyeong Park and Euyseok Hong. Software fault prediction model using clustering

algorithms determining the number of clusters automatically. International Journal ofSoftware Engineering and Its Applications, 8(7):199–205, 2014.

[6] Swati Varade and Madhav Ingle. Hyper-quad-tree based k-means clustering algorithmfor fault prediction. Inter. Journal of Computer Applications, 76(5):6–10, August 2013.

Department of Computer Science,, Faculty of Mathematics and ComputerScience,, Babes-Bolyai University, Kogalniceanu 1, Cluj-Napoca, 400084, Roma-nia.

E-mail address: {marianzsu, istvanc, gabis}@cs.ubbcluj.ro, {ssic0977}@scs.ubbcluj.ro

Page 61: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 59–62

A COMPARATIVE STUDY OF ARTIFICIAL INTELLIGENCE

METHODS FOR KINECT GESTURE RECOGNITION

ALINA DELIA CALIN(1)

Abstract. This paper analyses a natural interface sensor based gesturerecognition for the purpose of recognising indirect user input during gamingand create a more personalised and enjoyable experience. We have com-pared 38 classifiers on our own database of 30 different body postures andanalysed the results for the best performing of these, in terms of precision,accuracy and time. Also, next steps are discussed in terms of combiningmethods for more complex poses and gestures recognition.

1. Introduction

Considering some of the recent main uses of artificial intelligence meth-ods in the games domain, like solving difficult games and adapting gamesto enhance user experience, this paper looks into the most practical non-entertainment uses of video games, such as learning (educational), rehabili-tation (physical and cognitive therapies in healthcare) or solving world prob-lems, like the case of minority games (economical). The focus is on improvinghuman-computer interaction into a more natural and intuitive way, to makeuse of the indirect input from the user and to adapt the system to their actualneeds, which enhances the user experience and the gameplay benefits.

The next sections will present a review of the latest results obtained byusing artificial intelligence methods in games, especially for Kinect-based in-teraction, like gesture recognition, for which a performance comparison of themost promising methods is presented. Based on these results, we propose somedirections for expanding this research domain, in terms of better recognisingand interpreting user poses and gestures.

Received by the editors: 30 April 2015.2010 Mathematics Subject Classification. 68T50, 68T05.1998 CR Categories and Descriptors. H.5.2 [Information interfaces and presenta-

tion]: User Interfaces – Natural language; I.2.1 [Artificial Intelligence]: Applications andExpert Systems – Games.

Key words and phrases. gesture recognition, AI, Kinect, personalised games.

c©2015 Babes-Bolyai University, Cluj-Napoca

59

Page 62: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

60 ALINA DELIA CALIN

2. Related Work

Artificial intelligence has been widely used to create and solve complexgames. Some examples of the best results are based on methods like: neuralnetworks, reinforcement learning, evolutionary algorithms, adversarial learn-ing and digital pheromones. These are essential for creating competitive gamesfeatures: user profiles, complex and realistic non-player characters, and mainlypersonalised gameplay and adaptive game difficulty for a better enjoyment andengagement of the user [1]. This is important because games can be used effec-tively for educational or medical purposes, as they engage the user and maskthe serious educational or therapeutic purpose.

2.1. Gesture recognition with Kinect. Kinect is a natural interface sensorcreated for gaming, but with a huge potential and perspectives for general com-puter interaction based on human body language, as it detects and tracks 20human body joints in 3D. For detecting user body language related emotions,Saha et al. [2] have compared the classifiers k-nearest neighbour (k-NN), SVM(Support Vector Machine), Neural Network with Back-Propagation Learning(NNBPL), Binary Decision Tree and Ensemble Tree Classifier (ET). For a setof 5 gestures (scared, angry, happy, sad, relaxed) the best results were obtainedby ET (90%) and NNBPL (89%), followed by SVM (87%) and k-NN (86%).Results of up to 100% can be obtained when classifying a small number oftwo or three distinct poses (such as sit/stand/lie down with NNBPL, SVM,decision tree, and naive Bayes compared in [3]). Still, accuracy and precisionare very dependent on the gestures to be recognized and the methods used:85%–100% accuracy using Hidden Markov Models (HMM) on a set of 8 dis-tinct gesture [4] and 88,2% accuracy on a different set of 20 gestures usingHMM, Dynamic Temportal Warping (DTW), NN or action graph [5].

3. Performance comparison of several classifiers

Considering that poses represent a static body configuration and that ges-tures can be defined as a sequence of poses, the two should be approachedin a distinct way for obtaining best results. In this paper we will focus onpose detection, by studying a range of classifiers and comparing their perfor-mance results based on a database of poses that are likely to be meaningful inthe context of interacting with a serious game, in order to translate the useremotions and gestures, and personalise the system accordingly.

We have created a database containing 20 different poses, each pose havingbetween 15 and 30 different entries, and have used it for training and testingseveral classifiers using Weka 3.7 and 10-fold cross-validation. Poses wererepresented by all 20 joints provided by the Kinect sensor in 3D and indicate

Page 63: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

ARTIFICIAL INTELLIGENCE METHODS FOR KINECT GESTURE RECOGNITION 61

Figure 1. Top 14 Classifiers: Precision and Accuracy for theset with differentiated standing/sitting poses (marked with S,green and blue) and for the mixed data set (yellow and red).

Figure 2. Time (seconds) taken for each classifier to constructthe model. Time S refers to the differentiated set, as above.

possible actions like talking on the phone, scratching the head, praying, handscrossed, hands out in wonder, hands on hips, hands up (winning), coveringears or thinking, using one hand or both where applicable, with the user eitherstanding or sitting. When comparing performance, we have taken into accountprecision and accuracy, but also the computing time, in order to establishtheir potential to be used in real time applications. Results are presented inFigures 1 and 2, from which we can observe that the best results in termsof precision, accuracy and time are obtained for classifiers SimpleLogistic,MultiClassClassifier and RandomForest.

In order to avoid confusion of similar gestures, we have taken into accountthat some poses are much better recognized by the sensor while the user isstanding, so for the poses where mainly the upper body was relevant regardlessof lower body position, we have split the data into standing poses and sittingposes, obtaining a total of 30 distinct classes from the initial 20, with 15–20entries each. From this change we can generally observe that a larger number

Page 64: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

62 ALINA DELIA CALIN

of classes requires more computing time but it also increases precision for mostof the classifiers, except the previously top ones. The confusion matrix hasalso been computed and analysed for the purpose of detecting similar posesthat are more likely to be confused.

4. Conclusion and future work

Further on to this work would be to create a database of gestures andcompare some machine learning methods that are able to train and classifythe gestures based on this sequential data. This would be helpful for differ-entiating similar poses that are easily confused (which can be easily identifiedby examining the confusion matrix for the best classifiers). Also, using morepose data on similar gestures and using a sensor with higher sensitivity forgathering 3D data (like Kinect 2), as noise is also an issue, will be considered.

Acknowledgements

This work was partially supported by a grant of the Romanian Ministry ofEducation and Scientific Research, MECS – UEFISCDI, PN II – PT – PCCA– 2013 – 4 – 1797.

References

[1] Sander Bakkes, Chek Tien Tan and Yusuf Pisan, Personalised Gaming: A Motivationand Overview of Literature, ACM Proceedings of The 8th Australasian Conference onInteractive Entertainment: Playing the System, 2012.

[2] Sriparna Saha, Shreyasi Datta, Amit Konar and Ramadoss Janarthanan, A Study onEmotion Recognition from Body Gestures Using Kinect Sensor, International Conferenceon Communication and Signal Processing, India, April 3-5, 2014, pp. 56–60.

[3] Orasa Patsadu, Chakarida Nukoolkit and Bunthit Watanapa, Human Gesture Recog-nition Using Kinect Camera, 2012 Ninth International Joint Conference on ComputerScience and Software Engineering (JCSSE), pp. 28–32.

[4] Baoliang Wang, Zeyu Chen, Jing Chen, Gesture Recognition by Using Kinect SkeletonTracking System, 2013 Fifth International Conference on Intelligent Human-MachineSystems and Cybernetics, pp. 418–422.

[5] Jiang Wang, Zicheng Liu, Ying Wu, Junsong Yuan, Mining Actionlet Ensemble forAction Recognition with Depth Cameras, 2012 IEEE Conference on Computer Visionand Pattern Recognition (CVPR), pp. 1290–1297.

(1) Babes-Bolyai University, Faculty of Mathematics and Computer Science,Computer Science Department, No. 1 Mihail Kogalniceanu Street, RO–400084Cluj-Napoca, Romania

E-mail address: [email protected], [email protected]

Page 65: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 63–66

HYPERVIGILANCE DRIVER DETECTION

DANUT OVIDIU POP(1)

Abstract. Detection and tracking’s attentive concerning the driver’s emo-tional status and the detection of the obstacle in motion are crucial for thesafety of the autonomous vehicles. In the last decade many researches weremade to find a optimal solution in order to detect the driver’s emotionaland the results have skyrocketed. All researchers have used a large varietyof different protocols. My contribution on this paper is to put togethersome algorithms which have been used by researches on this issue. It isnot only an enumeration, it contains a short explanation about how thealgorithms have been used in this issue and my research direction. Theresearch direction is a combination between recognition of emotions fromface detection and recognition of emotions from physiological signals.

1. Introduction

Face detection is a major problem for computer’s vision which involve sev-eral applications including robotics, surveillance and the automotive industry.An intelligent object which is able to detect the hypervigilance driver’s canrevolutionize human life. Hypervigilance is an enhanced state of sensory sen-sitivity accompanied by an exaggerated intensity of behaviors whose purposeis to detect threats. Hypervigilance is also accompanied by a state of in-creased anxiety which can cause exhaustion.[7] I have detected that part ofhipovigilenge which has effect on human emotions such as stress, happiness,sleepiness and anxiety. Those emotional factors were detected from facial ex-pression and from physiological signals. The physiological signals which wereused for recognition emotions was detection pulse, heart beat, respiration ofhuman being and body temperature rhythm based on heart activity. Figure 1,which was originally proposed by Lisetti [2], shows the overall architecture of

Received by the editors: April 30, 2015.2010 Mathematics Subject Classification. 68T10.1998 CR Categories and Descriptors. I.2.9 [Artificial intelligence]: Robotics – Au-

tonomous vehicles; I.2.10 [Artificial intelligence]: Vision and Scene Understanding – Videoanalysis I.5.4 [Artificial intelligences]: Applications – Signal processing .

Key words and phrases. emotion, detection, driver, facial expression, physiologicalsignals.

c©2015 Babes-Bolyai University, Cluj-Napoca

63

Page 66: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

64 DANUT POP

the system that would recognize the drivers current affective state and respondaccordingly. Affective state of a driver can be assessed by interpreting boththe mental and the physiological components of the particular emotion experi-enced by the driver. Physiological components can be identified and collectedfrom observing the driver by using receiving sensors with different modalities:Visual (Facial Expressions), Kinesthetic (Autonomic Nervous System [ANS]Arousal and Motor Activities), and Auditory (Vocal Intonation) (V,K,A). [1]

Figure 1. Architecture of the system

2. The Overview

There are many algorithms which were used in this field, combinations oftheir detection systems, and intelligence agents which were used as differentor similare data sets but finally, they all offer similar results but with dif-ferent optimization factors. The major difference is the method used, or thecombination of algorithms even if the data sets are same. Some of databasesused in face detection are Yale and CMU PIE face databases. The Hazim Ke-mal Ekenel and Rainer Stiefelhagen[3] has proposed a local appearance basedface recognition algorithm. The algorithm local information is extracted usingblock-based discrete cosine transform. Obtained local features are combinedboth at the feature level and at the decision level.The performance of theproposed algorithm is tested on the Yale and CMU PIE face databases [3].

In [4] is developed a stress detection system based on the analysis of facialexpressions. They applied the supervised descent method (SDM).Basically,the method assumes that a valid shape can be estimated with a cascade of re-gression models, given an initial guess of the shape.The performance of the pro-posed algorithm is tested on the Face[5] and Radboud face databases[6] In [2]

Page 67: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

HYPERVIGILANCE DRIVER DETECTION 65

Figure 2. First row: Samples from the CMU PIE database.Second row: Samples from the Yale database

Figure 3. BodyMedia SenseWear Armband

is presented an emotion elicitation experiment where they used movie clips anddifficult mathematical questions to elicit six emotions: sadness, anger, surprise,fear, frustration, and amusement and a non-invasive wireless wearable com-puter BodyMedia SenseWear Armband (Figure 3) to collect the physiologicalsignals of their participants: galvanic skin response, heart rate, and tempera-ture. They were used three supervised learning algorithms were implementedto analyse these features: k-Nearest Neighbor (KNN), Discriminant FunctionAnalyses (DFA), and Marquardt Backpropagation (MBP) Algorithms.[2]

3. Experiments and Analysis

The aim of this experiment has been to detect the driver’s facial expres-sion and the driver’s emotions from physiological signals. The driver’s facialexpressions will be detected by the video camera. The performance of thealgorithm will be tested on the Yale,CMU PIE[3], Face[5] and Radboud facedatabases[6].The driver’s emotions from the physiological signals will be de-tected by various sensors which will be connected on arduino platform. Allsensors which will be used are listed and described in the Table no 1.

4. Conclusion and future work

This paper present just a part concerning the importance of the driver’shypervigilance detection and a small state of the art on this issue. An intel-ligent vehicle should have a part of monitoring the driver life. The majority

Page 68: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

66 DANUT POP

Sensors SummaryPulse sensor Detect pulse heart rateAD8232 Ecg module Monitoring the driver’s ECG.MQ-3 alcohol sensor If the alcoholic beverages were consumedTemperature sensor Detect the driver’s skin temperature.T2N2 sound sensor module Detected driver’s voice.

Table 1. Sensors name and their used

road accidents were made by driver’s fault. They had not able to react ondifferent health problems or emotional disorders appeared during they weredriving the vehicle. Human facial expression detection is an important factorfor detect driver’s status, but there are many human being when they havean emotional or health problems their facial expressions have not changed. Inthis case we considered that the emotion detection from different devices arevery important to offer the best results. For the future we propose to makean intelligent object which is able to detect hypervigilance driver’s by usinga device which detect the human facial expresion and in the same time otherdifferent divices for detecting the emotion from physiological signals.

References

[1] Christine L. Lisetti and Fatma Nasoz, Affective Intelligent Car Interfaces with Emo-tion Recognition, Proceedings of 11th International Conference on Human ComputerInteraction, NV, Las Vegas, USA, July 2005 http://citeseerx.ist.psu.edu/

[2] Christine L. Lisetti, A User Model of Emotion-Cognition, In Proceedings of the UM’99Workshop on Attitude, Personality, and Emotions in User-Adapted Interaction, Banf,Canada, June 1999.

[3] H. K. Ekenel and R. Stiefelhagen, Local Appearance Based Face Recognition Using Dis-crete Cosine Transform, In 13th European Signal Processing Conference (EUSIPCO2005), Antalya, Turkey, 2005. 2484–2489

[4] Hua Gao, Anil Yuce and Jean-Philippe Thiran, Detecting Emotional Stress From FacialExpressions For Driving Safety International Conference on Image Processing , Paris,France, 2014, 5961– 5965

[5] N. C. Ebner, M. Riedinger and U. Lindenberger, Faces - A database of facial expres-sion in young, middle-aged, and older women and men: development and validation,Behavior Research Methods, 42 (1), 2010, 351–362.

[6] O. Langner, R. Dotsch, G. Bijlstra and D. H. J. Wigboldus, Presentation and validationof the Radboud Faces Database, Cognition and emotion, 24 (8), 2010, 1377–1388.

[7] C. R. Kneisl, Contemporary Psychiatric-Mental Health, Just the Facts101, ContentTehnologies Inc, Cram101 Textbook Reviews, 2nd Edition, 2014.

(1) Babes-Bolyai University, Department of Computer Science, 1 M. KogalniceanuStreet, 400084 Cluj-Napoca, Romania

E-mail address: [email protected]

Page 69: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 67–70

SEMANTIC SIMILARITY MEASURES FOR LISTS OF

TAXONOMIC CODES

FLAVIA MICOTA(1), ROXANA DOGARU(1), AND DANIELA ZAHARIE(1)

Abstract. The aim of this paper is to investigate several semantic (dis)si-milarity measures between lists of taxonomic codes. The set of analyzedmeasures includes variants based on taxonomy edge counting as well asvariants based on estimating the information content of the nodes in thetaxonomy. The analysis is conducted in the case of taxonomies involving”is-a” and ”related-to” edges and the results are illustrated in the case ofestimating the (dis)similarity between lists of ACM classification codes.

1. Introduction

Taxonomies are classifications based on various relationships between en-tities. The standard hierarchical taxonomies are based on tree-like structureshaving entities placed in the nodes and edges corresponding to ”is-a” rela-tionships. An example of such a hierarchical taxonomy is ICD (Internal Clas-sification of Diseases) which is used to specify the diagnostics and medicalprocedures applied to a patient. There are also taxonomies which are notstrictly hierarchical, containing not only ”is-a” edges but also edges connectingarbitrarly placed nodes. Such a taxonomy which involves ”related-to” edgesbetween nodes is ACM (Computing Classification System) which describes therelations between various topics in computer science. The taxonomic codesare associated to the nodes in a taxonomy and can be used to provide in asynthetic way some information on entities specific to the domain for whichthe taxonomy has been constructed. For instance a patient record containsa list of ICD codes and a computer science paper can contain a list of ACMcodes. Such lists of codes can be interpreted as simple descriptors of the enti-ties and used in different data processing tasks (e.g. classification, clustering

2010 Mathematics Subject Classification. 62H30, 68P20.1998 CR Categories and Descriptors. I.5.3 [Pattern Recognition]: Clustering – Sim-

ilarity measures.Key words and phrases. taxonomy, semantic similarity measures, cluster validity indices.

c©2015 Babes-Bolyai University, Cluj-Napoca

67

Page 70: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

68 F. MICOTA, R. DOGARU, AND D. ZAHARIE

ACM

i.

i.2

i.2.8· · ·i.2.1

i.1

g.

g.2

· · ·

f.

f.2

f.2.2

sorting

searching· · ·pattern

matching

f.2.1

· · ·

f.1

f.1.3

· · ·

e.

e.5

· · ·

· · ·e.1

· · ·

d.

d.1

· · ·

.

.

.

.

Figure 1. Excerpt from the ACM taxonomy (”is-a” edges: solid

lines; ”related-to” edges: dashed lines)

etc). The (dis)similarity measures are key elements in clustering or instance-based classification, thus identifying appropriate measures is a critical step insuch tasks. The aim of this paper is to investigate several taxonomy-basedsimilarity measures and assess the quality of their extensions to lists of codes.

2. Measuring the dissimilarity between lists of taxonomic codes

2.1. (Dis)similarity between codes. Given two taxonomic codes C1 andC2, the similarity between them can be estimated by using the discrepancybetween the amount of common elements and the degree of their specificity.The commonalty of two codes can be estimated by using the most specificancestor, lca(C1, C2), i.e. the lowest node in the taxonomy which is commonto the ascending paths starting from C1 and C2 and going to the taxonomyroot through ”is-a” edges (solid lines in Fig. 1). On the other hand, thespecificity of a code is related to the information content of the correspondingnode in the taxonomy. The general structure of a such a measure is:

(1) sIC(C1, C2) = 2 · IC(lca(C1, C2))/(IC(C1) + IC(C2)).

Depending on the way the information content is estimated there are differenttaxonomy-based similarity measures. The simplest ones rely only on edgecounting, i.e. the information content is estimated using the depth of thenode. Such a measure was proposed by Wu and Palmer and is defined in Eq.(2) where depth denotes the number of edges from the tree root to the node.

(2) sWP (C1, C2) = 2 · depth(lca(C1, C2))/(depth(C1) + depth(C2)).

Recent variants to estimate the information content of a node in the taxonomyuse the ratio between a measure of its generality (related to the number of

Page 71: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

SEMANTIC SIMILARITY MEASURES FOR LISTS OF TAXONOMIC CODES 69

ancestors) and a measure of its concreteness (related to the number of descen-dants). Such a variant was proposed in [?] and is described in Eq. (3) where|L(C)| denotes the number of leaves of the sub-tree having the node corre-sponding to C as root, |L(T )| denotes the number of leaves in the taxonomyand |A(C)| denotes the number of ancestors of C including itself.

(3) IC1(C) = − log ((|L(C)|/|A(C)|+ 1)/(|L(T )|+ 1)) .

In Eq. (3) the descendents and the ancestors were identified using only the”is-a” edges. In order to take into account also the ”related-to” edges (thedashed arrows in Fig. 1) we propose the variants described in Eqs. (4) and(5). In these equations, R(C) denotes the set of all nodes which are directlyrelated to the node C and R∗(C) denotes the set of nodes which are linked toC through the transitive closure of the relation ”related-to”. R∗(C) includesalso C.

(4) IC2(C) = − log

( | ∪C′∈R∗(C) L(C ′)|/| ∪C′∈R∗(C) A(C ′)|+ 1

|L(T )|+ 1

)

(5) IC3(C) = − log

(|L(C)|/|A(C)|+

∑C′∈R(C) |L(C ′)|/|A(C ′)|+ 1

|L(T )|+ 1

)All measures (sWP , sIC1, sIC2, sIC3) take values in [0, 1] (the similarity ofidentical concepts is always 1, while the similarity of concepts having the rootas least common ancestor is always 0). Thus it is easy to construct dissimilaritymeasures by just subtracting the similarity value from 1. In the rest of thispaper the dissimilarity measures constructed based on these similarities are:δWP = 1− sWP , δIC1 = 1− sIC1, δIC2 = 1− sIC2, and δIC3 = 1− sIC3.

2.2. (Dis)similarity between lists of codes. The documents to be pro-cessed (patient records, computer science papers etc.) usually contain a listof codes, thus the code-level (dis)similarities should be extended to sets. Anatural idea is to use distances defined for sets, as is the Hausdorff distance.For a code-level dissimilarity δ and two finite sets of entities, A and B, theHausdorff dissimilarity is defined by:

(6) dH(A,B) = max{maxa∈A

minb∈B

δ(a, b),maxb∈B

mina∈A

δ(b, a)}.

It is easy to see that the set of possible values of dH coincides with the setof values taken by δ. As it is considered that the discriminant capacity of adissimilarity is related to the number of distinct values which it can take [?],we propose a variant based on the concept of the Dice dissimilarity:

(7) dD(A,B) = (∑a∈A

minb∈B

δ(a, b) +∑b∈B

mina∈A

δ(b, a))/(|A|+ |B|).

Page 72: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

70 F. MICOTA, R. DOGARU, AND D. ZAHARIE

Set 1 (7 tracks) Set 1 (4 tracks)d δWP δIC1 δIC2 δIC3 δWP δIC1 δIC2 δIC3

dH 0.594 0.599 0.599 0.591 0.470 0.457 0.477 0.450dD 0.482 0.481 0.492 0.474 0.390 0.390 0.405 0.383Table 1. C-index values computed using dissimilarity measures ob-

tained by combining 2 set-level measures with 4 code-level measures.

3. A case study based on the ACM taxonomy

The aim of the case study is to investigate the ability of the measurespresented in the previous section to express the similarity between papersbased on their corresponding lists of ACM classification codes. A collection of199 PDF files corresponding to a conference proceedings organized in trackshas been pre-processed in order to extract the list of ACM codes. To assessthe ability of the analyzed measures in explaining the observed structure indata (the existing partition by tracks of the papers) we propose the use ofa cluster validity index, i.e C-index, chosen according to the results of theevaluation methodology proposed in [?]. C-Index takes values in [0, 1] andas its value is smaller, the clustering quality, thus the ability of the similaritymeasure to express the relationships between the entities, is higher. The resultspresented in Table 1 correspond to two subsets of papers selected such thatthere are no papers with identical lists of codes assigned to different tracks.They suggest that the proposed variant which uses the direct ”related-to”edges in the estimation of the information content leads to the best results forboth set-level dissimilarities (Hausdorff and extended Dice).

References

(1) Department of Computer Science, West University of Timisoara, RomaniaE-mail address: {zflavia|rdogaru|dzaharie}@info.uvt.ro

Page 73: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 71–74

ORDINAL DATA ANALYSIS USING AGGLOMERATIVE

CLUSTERING ALGORITHMS

ADRIANA M. COROIU(1), RADU D. GACEANU(1), AND HORIA F. POP∗,(1)

Abstract. Clustering validation represents essential issues in clusteringapplication. Using clustering algorithms applied on ordinal data and choos-ing a certain linkage criteria represents also an important point in cluster-ing. We present clustering agglomerative algorithms running on ordinaldata sets, using different linkage criteria (ward, median, centroid, weighted,group, complete and single linkage method). The experiments reveal dif-ferent comparative results. To validate our clustering results, we used paircounting measures (Jaccard, Recall, Rand and Fowlkes Mallows indices),Bcubed based measures (F1-Measure and Precision), set matching basedmeasures and editing distance measures (Purity, Inverse Purity, Precisionand Recall) - for external evaluation and Silhouette index for analyze in-trinsic characteristics of a clustering - internal evaluation. The comparativeexperiments for different linkage methods suggest that for an ordinal dataset, the ward linkage methods provide a better clustering result than anyother linkage criteria applied.

1. Introduction

The explosive growth of available data volume and data kinds comes withthe need of developing methods for analysing these data and coping with boththe increase in volume as well as with the diversification of data kinds. Accord-ing to [4], variables may be classified into the following categories: nominal(categorical), binary, ordinal, or numeric. The values of categorical variables,like gender or color, are symbols, names, or categories, with no intrinsic order-ing between categories. As opposed to categorical variables, in ordinal ones,there is a clear ordering between categories. Ordinal variables are very com-mon in fields like economics or social sciences. An example of such a variableis customer satisfaction which could take one of the following values: verydissatisfied, somewhat dissatisfied, neutral, satisfied, very satisfied. The valuesof ordinal variables (as well as categorical and binary ones) are qualitative, in

Received by the editors: April 30, 2015.2010 Mathematics Subject Classification. 68T10, 62H30.1998 CR Categories and Descriptors. I.5.3 [Pattern Recognition]: Clustering – Algo-

rithms.Key words and phrases. Ordinal Data Analysis, Agglomerative Clustering.∗ Corresponding author.

c⃝2015 Babes-Bolyai University, Cluj-Napoca

71

Page 74: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

72 ADRIANA M. COROIU, RADU D. GACEANU, AND HORIA F. POP

the sense that they describe an object in terms of a word, or a symbol, withoutassigning it a quantity, or a size.

The problem with ordinal variables is the fact that one cannot directlycompute distances, mean, or standard deviation on such data. Even if ranksare associated to the given categories, the size of the difference between twocategories is in general inconsistent. If the difference between categories wasmeasurable then the variables would be considered interval-based or ratio-based in which case distances, mean, and standard deviation would be well-defined. Since this is not always the case, the problem of ordinal data analysisis an important one especially in fields like economics or social-behaviouralsciences, where data is often ordinal by nature. Our aim is to study theapplicability of clustering algorithms on ordinal data. We consider a NaiveAgglomerative Clustering approach and the Slink algorithm [5] with severallinkages and we apply them on a standard dataset [2] with ordinal data.

The paper is structured as follows: Section 2 presents the agglomera-tive clustering algorithms, Section 3 describes the performed experiments andprovides an interpretation of the obtained results, and Section 4 draws theconclusions and presents ideas for future work.

2. Agglomerative clustering

As opposed to divisive clustering algorithms, the agglomerative counter-parts consider each instance as a singleton cluster and then successively mergepairs of clusters. The process may be summarized in the following steps:

(1) Assign each object to a separate cluster;(2) Evaluate all pair-wise distances between clusters;(3) Look for the pair of clusters (ci, cj) with the shortest distance;(4) Merge clusters ci and cj ;(5) Repeat until only one cluster is obtained or another stopping criterion

is met.

One advantage of hierarchical clustering algorithms over partitioning al-gorithms are that the clusters number does not need to be known in advance,there is no initial assignment of data to clusters needed, and also a distancemeasure between data items is not necessary. The algorithms only needs anintercluster similarity measure (which may be based on a data point similar-ity measure). The most common linkage measures are single linkage, completelinkage and average linkage.

Each linkage comes with its own drawbacks. Single linkage can produce“chaining”, meaning that a sequence of close items in different clusters causeearly merges of those clusters. On the other hand, complete linkage mightnot merge close clusters because of outlier members that are far apart. Groupaverage represents a natural compromise, but depends on thescale of the sim-ilarities; applying a monotone transformation to the similarities can changethe results [1]. Consequently, a good selection of linkage method is essentialfor the quality of the clustering process.

Page 75: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

ORDINAL DATA ANALYSIS 73

3. Experiments and discussion

The data set used in our experiment was Dermatology data set - a data setwith 366 instances and 33 attributes and the attribute characteristics are cate-gorical, accessible at https://archive.ics.uci.edu/ml/datasets/Dermatology. Ev-ery feature (clinical and histopathological) was given a degree in the range of 0to 3: 0 value indicates that the feature was not present, 3 indicates the largestamount possible, and 1, 2 indicate the relative intermediate values.

We have used an open source data mining software written in Java calledELKI [3] on which focus is research in algorithms, with an emphasis on unsu-pervised methods in cluster analysis and outlier detection. We have runningtwo agglomerative clustering algorithms: Slink and Nave aglomerative clus-tering algorithm. For both algorithms we have chosen different linkage criteria(ward, median, centroid, weighted, group, complete and single linkage).

For Pair counting measures we have gathered the following value indices:Jaccard, Recall, Rand and Fowlkes Mallows. Jaccard Index is a similaritycoefficient of two clustering of the same data set under the assumption thatthe two clustering are independent.

Rand index correctly classified pairs of elements, its value between 0 and1 reveals the fact that two partitions agree perfectly for 1 value or not at allfor 0 value. FMI is an external evaluation method that is used to determinethe similarity between two clustering. In our experiments, as we can see inTable 1, we get a greater value of Jaccard, Rand and Fowlkes Mallows withward linkage method in comparison to other linkage methods analyzed, whichmeans that this linkage method provides a more‘ accurate clustering methodthan other linkage methods applied on agglomerative clustering algorithm.

The second set of evaluation methods on which we have values of indices isBCubed-based measures - BCubed metrics decompose the evaluation processestimating the precision and recall associated to each item in the distribution.In our case, our experiments outline a higher value of precision which meansthat the cluster achieved is more precision-oriented. A higher value of precisionis achieved applied no matter of linkage methods on agglomerative algorithms.

Finally the set matching based measures and editing distance measuresthis metric share feature of assuming a one to one mapping between clustersand categories. The indices gathered from this measures method are purityand inverse purity. Our results show a lower value for inverse purity and ahigher value for purity, which means that the clustering methods return goodresults. The purity results for our linkage criteria show that with single linkagemethod, we get a higher value for purity (0.84) than for ward linkage method(purity value 0.78), so according to these set matching measurements, thesingle linkage criterion provides better results than other linkage criteria.

For internal evaluation of a clustering, the analyzed value is the silhouetteindex which validates clustering performance based on the pairwise differenceof between and withincluster distances. In our experiments, we have achievedhiger value with ward linkage methods than with single linkage methods. The

Page 76: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

74 ADRIANA M. COROIU, RADU D. GACEANU, AND HORIA F. POP

achieved values are between 0.50 and 0.70 and these values of silhouette indexoutiline that reasonable structure has been found.

In Table 1 we show the results for the two algorithms using different linkagecriteria.

Index NavewithWard

SlinkwithWard

NavewithSgl

SlinkwithSgl

NaivewithCntr

SlinkwithCntr

NaivewithGroup

SlinkwithGroup

Jaccard 0,20 0,65 0,19 0,60 0,51 0,52 0,37 0,38Recall 0,20 0,65 0,19 0,75 0,51 0,52 0,37 0,38Rand 0,21 0,65 0,41 0,90 0,63 0,64 0,38 0,39FowlkesMallows 0,44 0,81 0,43 0,75 0,71 0,72 0,60 0,61Precision 0,33 0,79 0,24 0,81 0,55 0,56 0,53 0,54Purity 0,29 0,78 0,36 0,84 0,61 0,62 0,49 0,50F1-Measure 0,45 0,87 0,50 0,83 0,71 0,72 0,65 0,66Recall 0,98 0,97 0,83 0,83 0,85 0,86 0,98 0,98Silhouette 0,63 0,34 0,70 0,46 0,62 0,61 0,57 0,58

Table 1. Values achieved

4. Conclusions and future work

The aim of this paper was to study the aglomerative clustering algorithmsin the case of ordinal data sets. We have performed tests using Naive algorithmand Slink aglomerative clustering algorithm. We have studied appropiate link-age criteria to be used for particular algorithms. Our experiments reveal goodresults in term of clustering evaluation for the ward linkage criteria as com-pared to other linkage criteria.

As future work we plan to investigate the performance of partitional clus-tering methods in comparison to hierarchical ones (agglomerative and divisive)applied on ordinal data, as well as figuring out a way to introduce robustnessvia fuzzy logic.

Acknowledgements. This work was supported by a grant of the Roma-nian National Authority for Scientific Research, CNDI–UEFISCDI, projectnumber PN-II-PT-PCCA-2011-3.2-0917.

References

[1] Charu C Aggarwal. Data Classification: Algorithms and Applications. CRC Press, 2014.[2] Machine Learning Repository Dermatology. https:// archive.ics.uci.edu/ ml/ datasets/

dermatology, 1998.[3] ELKI: Environment for Developing KDD-Applications Supported by Index-Structures.

http://elki.dbs.ifi.lmu.de, 2014.[4] Jiawei Han, Micheline Kamber, and Jian Pei. Data Mining: Concepts and Techniques.

Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 3rd edition, 2011.[5] R. Sibson. SLINK: an optimally efficient algorithm for the single-link cluster method.

Comput. J., 16(1):30–34, 1973.

(1) Department of Computer Science, Babes-Bolyai University, RomaniaE-mail address: {adrianac,rgaceanu,hfpop}@cs.ubbcluj.ro

Page 77: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 75–78

FEATURE SELECTION FOR IMBALANCED PROBLEMS

CAMELIA LEMNARU(1) AND RODICA POTOLEA(1)

Abstract. Although the performance of classifiers is affected by imbal-anced distributions, the role of feature selection in alleviating this issue hasbeen less investigated. This work attempts to fill in this gap, by providinga theoretical survey of specific feature selection methods for such problemsand a comparative analysis of the performance boost generated by differ-ent selection strategies. The results indicate that ranker methods do notproduce performance improvements. The best feature selection strategyfor performance improvement is the wrapper methodology, which achievesa space reduction of about 40% and can also boost the performance.

1. Introduction

Classification in the presence of an imbalanced data distribution is a sig-nificant challenge in the data mining community, with numerous real-worldproblems facing this scenario - text mining, fraud or intrusion detection, med-ical diagnosis, risk management, unexploded ordnance and mine detection -and papers, research groups and workshops focusing on this issue. A classifica-tion problem is imbalanced if, in the available data, a class (the one of utmostinterest in recognition) is represented by a very small number of instancescompared to the others [3]. The straightforward measure to characterize theimbalance for a 2-class problem is the Imbalance Ratio (IR). Most traditionalclassifiers are affected by the class imbalance problem to some extent [3, 7].As a result, a great deal of effort has been invested in developing classificationmechanisms for coping with the data imbalance. Significantly less work hasbeen directed towards studying the effect of general and specific feature selec-tion methods on the classification performance in imbalanced problems. Thecurrent work focuses on providing a significant theoretical survey of specificfeature selection methods for imbalanced classification problems, and a com-parative empirical analysis of the efficiency of different selection strategies inimproving the performance of various classifiers.

2010 Mathematics Subject Classification. 68T99.1998 CR Categories and Descriptors. H.2.8 [Database Applications]: Data mining.Key words and phrases. data mining, imbalanced classification, feature selection, wrap-

per, performance.

c©2015 Babes-Bolyai University, Cluj-Napoca

75

Page 78: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

76 LEMNARU AND POTOLEA

2. Related Work

The role of feature selection in achieving a successful data mining processhas long been acknowledged in both the research and industry communities,as a mechanism for reducing complexity and improving model interpretabil-ity and/or computation time [6]; also, wrapper methods are known for theirpotential in improving the performance of the classification model [5]. Theirsuitability in imbalanced classification problems has been less investigated,with the main contributions appearing within the last decade. In the follow-ing, we present a brief overview of the specific techniques existing in literature.The most investigated feature selection strategies in imbalanced problems areranker methods, with FAST–Feature Assessment by Sliding Thresholds [9]being seemingly the most prominent approach. It assesses the importance ofeach feature independently, by approximating the value of the AUC (Area Un-der the ROC Curve) generated by that feature; the approximation is obtainedby using an even-bin distribution and a fixed number of threshold points, k.A modification to the basic FAST approach, which considers precision-recallcurves has been proposed in [9]. ARCO–AUC and Rank Correlation coef-ficient Optimization [8], adopts the minimal redundancy maximal relevancefeature (mRMR) selection criterion: as relevance measure, the method adoptsthe AUC of a single feature (as in FAST); as redundancy measure, it employsthe Rank Correlation Coefficient (RCC). Thus, ARCO iteratively orders fea-tures by taking into account the AUC and the correlation with the alreadyselected features. The Contribution Selection Algorithm (CSA) [1] is a hybridfilter-wrapper method which employs Multi-perturbation Shapley Analysis toestimate feature usefulness iteratively; in order to estimate feature usefulnessit employs a wrapper-like criterion: estimate the contribution of the feature inimproving the classifiers performance in conjunction with other features. Toreduce the size of the search space, the method uses a bound on the featuresubset size, d. Feature Selection method based on SHapley value (FSSH) [2]is a filter which operates with principles similar with those of CSA; the maindifferences between CSA and FSSH is that the latter generates subsets of only3 features and employs an estimate of the AUC value as the marginal impor-tance of each feature within a coalition (no classifier involved). FSSH selectsthe top 2% features during each iteration and it employs a fixed number ofiterations, as opposed to CSA. In [4], the authors propose three strategies formodifying the basic ReliefF algorithm to take into account data imbalance:the Higher Weight (HW) strategy assigns a higher weight to attributes whichare able to differentiate a minority example from majority examples; Differ-ential Minority Repeat (DMR) balances the training set by over-sampling theminority class, whereas Balanced Minority Repeat (BMR) creates N balanceddatasets via decomposition and sub-sampling of the majority class; ReliefFis then applied on each of the N sets and the results are aggregated. The

Page 79: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

FEATURE SELECTION FOR IMBALANCED PROBLEMS 77

following observations can be formulated. Firstly, the data employed in exist-ing evaluations of feature selection techniques in imbalanced problems comesexclusively from areas in which we are dealing with the small sample and highdimensionality problems, such as text classification, or gene expression. Con-sequently, existing specific techniques aim to reduce the number of attributesas primary objective; they must be efficient and robust to over-fitting - whichresulted in an intensive investigation of ranker methods. In order to adapt tothe imbalance, existing methods either employ metrics which take into accountthe imbalance or distribution altering techniques (e.g. sampling, weighting).

3. Experimental Work

The aim of the current work is to investigate comparatively the effect ofdifferent feature selection strategies on the performance of classifiers in imbal-anced domains. We have considered three feature selection mechanisms: theFAST ranker, a filter - Correlation based Feature Selection (CFS) and severalvariations of the wrapper methodology. For FAST, we have employed threeselection thresholds: 25%, 50% and 75% of the initial number of attributes.For the filter and wrapper methods, two different search mechanisms were con-sidered: bidirectional best-first search (Best) and greedy backward elimination(Bwd), and three evaluation functions for the wrapper: the Accuracy (Acc),Balanced Accuracy (BAcc) and TPrate (TPR). Classifiers belonging to fivedifferent classes have been investigated: k-Nearest Neighbor (kNN), decisiontrees (J4.8), Support Vector Machines (SVM),Nave Bayes (NB) and RandomForrest (RF). The experiments have been performed on 30 binary problemsprovided by the UCI ML Data Repository. The evaluations and necessaryimplementations have been developed within the WEKA framework, using a10-fold cross-validation procedure. Due to space limitations, we present onlythe results obtained for large imbalance datasets (Table 1).

We can observe that: (1) Filters do not improve significantly classifierperformance; as the number of selected attributes increases, FAST producesbetter results; FAST performs better than CFS overall. CFS removes too manyattributes, and we conclude that it is not useful in imbalanced problems. (2)Wrappers produce a certain improvement in the performance of the NB andkNN classifiers, a less perceptible improvement if J4.8 and RF and almost nochange in the performance of the SVM. Using BAcc with Bwd search yields thebest results. The combinations which retain about 60% of the initial numberof attributes obtain the best results (about 1%).

4. Conclusions

The current abstract provides a condensed view on specific feature selec-tion methods for imbalanced problems and a comparative experimental study

Page 80: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

78 LEMNARU AND POTOLEA

Base CFSBest

CFSBwd

FAST25%

FAST50%

FAST75%

WAccBest

WBAccBest

WTPRBest

WAccBwd

WBAccBwd

WTPRBwd

NB 0.79 0.73 0.73 0.72 0.79 0.79 0.77 0.81 0.78 0.78 0.82 0.78kNN 0.78 0.79 0.79 0.76 0.81 0.80 0.77 0.83 0.80 0.84 0.84 0.83J48 0.84 0.79 0.79 0.78 0.80 0.81 0.80 0.81 0.81 0.82 0.84 0.84RF 0.83 0.79 0.79 0.78 0.83 0.84 0.79 0.83 0.83 0.83 0.84 0.84SMO 0.72 0.57 0.57 0.59 0.65 0.66 0.64 0.65 0.64 0.72 0.72 0.72

Table 1: BAcc average values, large imbalance datasets (IR >5)

on general and specific feature selection methods. The evaluation results indi-cate the best improvement is obtained via wrapper methodologies, but not allclassifiers are improved. However, we believe that wrappers can be adaptedand paired with other mechanisms (such as sampling) to produce hybrid strate-gies for improving the behavior of classifiers in imbalanced problems.

References

[1] Shay Cohen, Eytan Ruppin, and Gideon Dror. Feature selection based on the shapleyvalue. In Proc. of IJCAI’05, pages 665–670, 2005.

[2] Jamali I., Bazmara M., and Jafari S. Feature selection in imbalance data sets. Interna-tional Journal of Computer Science Issues, pages 42–45, 2012.

[3] Nathalie Japkowicz and Shaju Stephen. The class imbalance problem: A systematicstudy. Intell. Data Anal., 6(5):429–449, October 2002.

[4] Abu H. M. Kamal, Xingquan Zhu, Abhijit S. Pandya, and Sam Hsu. Feature selectionwith biased sample distributions. In IRI, pages 23–28, 2009.

[5] Ron Kohavi and George H. John. Wrappers for feature subset selection. Artif. Intell.,97(1-2):273–324, December 1997.

[6] R Nilsson. Statistical Feature Selection: With Applications in Life Science. Linkopingstudies in science and technology: Dissertations. Department of Physcis, Chemistry andBiology, Linkoping University, 2007.

[7] Rodica Potolea and Camelia Lemnaru. A comprehensive study of the effect of classimbalance on the performance of classifiers. In ICEIS 2011 - Proceedings of the 13thInternational Conference on Enterprise Information Systems, Volume 1, Beijing, China,8-11 June, 2011, pages 14–21, 2011.

[8] Rui Wang and Ke Tang. Feature selection for maximizing the area under the roc curve.In Proceedings of the 2009 IEEE International Conference on Data Mining Workshops,ICDMW ’09, pages 400–405, Washington, DC, USA, 2009. IEEE Computer Society.

[9] Mike Wasikowski and Xue W. Chen. Combating the small sample class imbalance prob-lem using feature selection. IEEE Tran. on Knowl. & Data Eng., 22(10):1388–1400, 2010.

(1) Technical University of Cluj-Napoca, Computer Science DepartmentE-mail address: [email protected] address: [email protected]

Page 81: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 79–81

INTEGER PROGRAMMING VIA GROBNER BASES -MAXIMA IMPLEMENTATION

VALERIU ANISIU(1)

Abstract. The purpose of this paper is to obtain an implementation ofa Linear Integer Optimization Program in Maxima.

We formulate the standard Linear Integer Program in the following way:Let A = (aij) be a m×n matrix with integer elements bi ∈ Z, cj ∈ R (i.e.

A ∈ Zm×n, b ∈ Zm, c ∈ Rn).Seek x = (x1, ..., xn) ∈ Nn0 such thatAx = b and cx→ minDenote P = {x ∈ Nn0 : Ax = b}

A. If aij ≥ 0, bi ≥ 0 for all i, j, then we can obtain a polynomialformulation

We shall write for X = (X1, ..., Xm), a = (a1, ..., am) ∈ Nm0 ; Xa :=Xa1

1 ...Xamm

The system can be written as a polynomial one in the new indeterminatesX = (X1, ..., Xm) :

Xa11x1+...+a1nxn1 · ... ·Xam1x1+...+amnxn

m = Xb11 · ... ·Xbm

m

or, equivalently

(Xa111 ...Xam1

m )x1 · ... · (Xa1n1 ...Xamn

m )xn = Xb.

Consider the ring homomorphism Φ : K[Y1, ..., Yn] → K[X1, ..., Xm] de-fined by Φ(Yk) := Xa1k

1 ...Xamkm .

Denoting Ak = (a1k, ..., amk) the kth column of A, then Φ(Yk) := XAk

Then our system is

Φ(Y x11 ...Y xn

n ) = Xb

Received by the editors: ...2010 Mathematics Subject Classification. 90-04, 12Y05.1998 CR Categories and Descriptors. [G.1.6]: – Linear programming ;Key words and phrases. Grobner bases, linear integer programming.

c©2015 Babes-Bolyai University, Cluj-Napoca

79

Page 82: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

80 V. ANISIU

So, the system Ax = b has a solution in Nn0 (i.e. P 6= ∅) iff Xb is in theimage of Φ.

The Conti&Traverso algorithm has the following simple steps:

(1) Define the ideal I generated by the polynomials Yk − XAk for k ∈{1, ..., n} in the polynomial ring K[X1, ..., Xm, Y1, ..., Yn].

(2) Define the monomial order <=<c i.e. Yp < Yq ⇐⇒ (cp < cq) or(cp = cq and p < q)[i.e. we take the “cost order”] and X1 > ... > Xm > Yi.[Recall that during the computations with Grobner basis, X1 is firsteliminated, then X2 etc].

(3) Compute the remainder (=Normal Form ) R of Xb wrt I. R is inK[X1, ..., Xm, Y1, ..., Yn].

(4) P 6= ∅ iff R ∈ K[Y1, ..., Yn].

Actually R will be a monomial in K[Y1, ..., Yn] of the form Y β11 ...Y βn

n

(if the cost order is considered).

The optimal solution will be x = (β1, ..., βn).

B. Assume now the general case: aij , bi are allowed to be < 0The idea is to introduce a new variable W.

(1) Define the ideal I generated by the polynomials Yk−XA′kWαk for k ∈{1, ..., n} andX1X2...XmW−1 in the polynomial ringK[X1, ..., Xm,W, Y1, ..., Yn]

where A′k = Ak + αk

11...1

, αk ∈ N0 chosen s.t. A′k ≥ 0 (e.g.

αk = max(−minAk, 0))

Similarly choose β ∈ N0 such that b′ = b+ β

11...1

≥ 0.

(2) Define the monomial order <=<c i.e. Yp < Yq ⇐⇒ (cp < cq) or(cp = cq and p < q)[i.e. we take the “cost order”] and X1 > ... > Xm > W > Yj .

(3) Compute the remainder (=NormalForm) R of Xb′W β wrt I. R is inK[X1, ..., Xm,W, Y1, ..., Yn].P 6= ∅ iff R ∈ K[Y1, ..., Yn].

Actually R will be a monomial in K[Y1, ..., Yn] of the form Y β11 ...Y βn

n .(ifthe cost order is considered).

The optimal solution will be x = (β1, ..., βn).

Page 83: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

INTEGER PROGRAMMING - MAXIMA 81

C. The algorithm modificationThe monomial order considered above is working for c > 0 (because at each

step in the construction of the Grobner basis, the cost function decreases). Iteven works for c ≥ 0 but in this case the minimal point is not necessarilyunique. If c has negative entries, a monomial order can be obtained but it istoo complicated to be implemented.

Denote NC := {j : cj < 0}If NC 6= ∅ we suppose that ∃M > 0 such that xj ≤M ∀x ∈ P,j ∈ NC.

(1) For each j ∈ NC :• c[j] := −c[j]• b := b−M ·A[., j]• A[., j] := −A[., j]

(2) For each j ∈ NC, the matrix A is augmented by a row and a columnand a new entry is added to b and c :• c[n+ 1] := 0• b[m+ 1] := M• A[m+ 1, j] := 1, A[m+ 1, n+ 1] := 1• m := m+ 1, n = n+ 1

(3) The new problem is solved using the previous algorithm (c ≥ 0) ob-taining the solution x = (x1, ...)

(4) For each j ∈ NC, xj := M − xj .(5) The solution is x.

Note. A valid value for M could be found using a standard simplex methodfor max xj (or globally

∑xj).

A concise Maxima program is implemented.

References

[1] P. Conti, C. Traverso - Buchberger algorithm and integer programming. ProceedingsAAECC-9 (new Orleans), Springer LNCS, (1991) 539, p. 130-139

[2] R.R. Thomas. - A Geometric Buchberger Algorithm for Integer. Programming. Mathe-matics of Operations Research, (1995) Vol 11, No.1 , p. 864-884.

[3] M. Mencinger - On Groebner Bases and Their Use in Solving Some Practical Problems.Univ J. of Computational Mathematics 1(1): 5-14, 2013

[4] T. Hibi (ed) - Grobner Bases. Springer 2013

(1) Faculty of Matematics and Computer Science, Babes-Bolyai University,Cluj-Napoca, Romania

E-mail address: [email protected]

Page 84: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 82–85

AN AGGLOMERATIVE CLUSTERING APPROACH USING

SOFTWARE AGENTS

RADU D. GACEANU(1) AND ARNOLD SZEDERJESI(1)

Abstract. In hierarchical clustering algorithms, the number of clustersdoes not need to be known in advance and there is no initial assignmentof data to clusters needed. On the other hand, they are computationallyexpensive which makes them impractical when applied on large datasets.A possible way to overcome this drawback would be to parallelize theclustering process and thus we present an agglomerative clustering algo-rithm based on software agents. Experiments on standard datasets suggestpromising results compared with other two clustering algorithms.

1. Introduction

In data analysis, hierarchical clustering is a cluster analysis method whichworks by building, as the name suggests, a hierarchy of clusters and it comes intwo flavours: agglomerative and divisive. The agglomerative approach startsby considering one cluster for each data item and it repeatedly merges pairsof clusters as one moves up the hierarchy. Conversely, the divisive approachstars by considering all items into one cluster and it repeatedly splits theclusters as one moves down the hierarchy. Hierarchical clustering algorithmsare considered slow for large datasets [1] and thus, a possible way to overcomethis drawback would be to parallelize the process.

In this paper we address the agglomerative clustering problem using severalagents that interact in parallel by direct message exchange. We have chosento implement our solution in the Elixir [4] programming language because ithas been specifically designed for concurrent applications and hence the de-velopment of independently acting agents becomes a lot easier. Built on topof Erlang VM, Elixir is a functional, dynamic, meta-programming aware lan-guage with flexible syntax similar to Ruby and macro support that leverages

Received by the editors: April 30, 2015.2010 Mathematics Subject Classification. 68T42.1998 CR Categories and Descriptors. I.2.11 [Artificial Intelligence]: Distributed Arti-

ficial Intelligence – Multiagent systems.Key words and phrases. Agglomerative Clustering, Agent, Elixir.

c©2015 Babes-Bolyai University, Cluj-Napoca

82

Page 85: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

AGGLOMERATIVE CLUSTERING 83

Erlang’s abilities to build concurrent, distributed and fault-tolerant applica-tions with hot code upgrades. We apply our approach on standard datasets[3, 6, 7] and we compare our results with the well-known k-means algorithmfrom an open source benchmark [5].

The paper is organized as follows: Section 2 presents our approach toagglomerative clustering using agents, Section 3 describes our experimentalsetup and compares the obtained results to the related work. Conclusions andideas for future work are presented in Section 4.

2. Agent based clustering approach

In hierarchical clustering algorithms, the number of clusters does not needto be known in advance and there is no initial assignment of data to clustersneeded. These are important advantages over other clustering algorithms likek-means. Nevertheless, hierarchical clustering algorithms are computationallydemanding and hence an agent based agglomerative approach may be moreappropriate. In the following, we provide a Pseudocode description of ourapproach.

Algorithm 2.1 Agglomerative Agent Clustering

1: Input: name, imax, σ, λ2: Output: clusters3: data = read data and normalize(name)4: agents = initialize agents(data)5: for all i ∈ range(0, imax) do6: for all agent ∈ agents do7: cluster = get cluster(agent)8: similar agent = search for similar(cluster, λ, σ)9: if similar agent! = null then

10: new cluster = get cluster(similar agent)11: change cluster(agent, cluster)12: end if13: end for14: end for15: representatives = create cluster representatives()16: for all representative ∈ representatives do17: if @ representative is similar with cluster from clusters then18: cluster = cluster

⋃{representative}

19: @ change cluster for each data from the representative′s cluster20: else21: clusters = clusters

⋃new cluster(representative)

22: end if23: end for24: representatives = build representatives()25: {outliers, clusters} = detect outliers(representatives)26: new clusters = join outliers(outliers, clusters)27: return new clusters

Page 86: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

84 RADU D. GACEANU AND ARNOLD SZEDERJESI

In Algorithm 2.1, the parameter name denotes the name of the considereddataset, imax represents the maximum number of iterations, σ is the similarityrate, and λ is the number of trials to find a similar agent.

3. Experiments and discussion

In Table 1 we show the results of applying our algorithm on three standarddatasets: Seeds [7], Cancer [3], and Iris [6]. We have also applied the K-means clustering algorithm on the considered datasets by using ELKI [5], anopen source software environment for data mining. As Table 1 suggests, ourapproach outperforms the K-means algorithm on most cases, on the considereddatasets.

Agent based clustering K-means clusteringCluster True

posi-tives

Falseposi-tives

Total Pre-cision

Trueposi-tives

Falseposi-tives

Total Pre-cision

Seeds datasetKama 62 11 73 88.57% 60 12 72 85.71%Rosa 63 2 65 90% 60 1 61 85.71%Canadian 66 6 72 94.28% 68 9 77 97.14%

Cancer datasetBenign 218 8 226 90.45% 223 11 234 92.53%Malignant 450 23 473 98.25% 447 18 465 97.59%

Iris datasetIris-setosa 50 0 50 100% 22 0 22 44%Iris-versicolor 49 4 53 98% 3 28 31 6%Iris-virginica 46 1 47 92% 50 0 50 100%

Table 1. Comparison between our approach and the k-meansclustering algorithm.

In [2], the authors introduce a Complete Gradient Clustering Algorithmfor feature analysis of X-ray images. According to [2], the main idea of thealgorithm is that each cluster is identified by humps of the kernel densityestimator of the data and the number of clusters is determined by numberof local maxima of the estimator. In order to validate their approach, theSeeds [7] dataset is considered. In Table 2 we provide a comparison betweenour approach and the algorithm from [2]. As it may be seen, our approachoutperforms the algorithm form [2] in one out of the three cases.

4. Conclusions and future work

The proposed agglomerative clustering algorithm addresses the issues ofclassical hierarchical clustering algorithms by employing software agents imple-mented in Elixir, a language specifically designed for concurrent programming.

Page 87: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

AGGLOMERATIVE CLUSTERING 85

Agent based clustering Complete gradient clusteringCluster True

posi-tives

Falseposi-tives

Total Pre-cision

Trueposi-tives

Falseposi-tives

Total Pre-cision

Seeds datasetKama 62 11 73 88.57% 67 2 69 97.1%Rosa 63 2 65 90% 59 6 65 90.77%Canadian 66 6 72 94.28% 67 9 76 88.16%

Table 2. Comparison between our approach and the Com-plete gradient clustering algorithm.

Experiments on standard datasets exhibit good results compared to the clas-sical K-means algorithm, and to the Complete Gradient Clustering Algorithmconsidered in the related work. As future work, we plan to test our algorithmon large datasets, to consider datasets with mixed variable types and to testour approach in outlier detection.

Acknowledgements

This work was supported by a grant of the Romanian National Authorityfor Scientific Research, CNDI–UEFISCDI, project number PN-II-PT-PCCA-2011-3.2-0917.

References

[1] Charu C Aggarwal. Data Classification: Algorithms and Applications. CRC Press, 2014.[2] Magorzata Charytanowicz, Jerzy Niewczas, Piotr Kulczycki, PiotrA. Kowalski, Szymon

ukasik, and Sawomir ak. Complete gradient clustering algorithm forfeatures analysisof x-ray images. In Ewa Pitka and Jacek Kawa, editors, Information Technologies inBiomedicine, volume 69 of Advances in Intelligent and Soft Computing, pages 15–24.Springer Berlin Heidelberg, 2010.

[3] Breast Cancer Dataset. Machine learning repository, http://archive.ics.uci.edu/ ml/datasets/ breast+cancer+wisconsin.

[4] Elixir. http://elixir-lang.org/.[5] ELKI: Environment for Developing KDD-Applications Supported by Index-Structures.

http://elki.dbs.ifi.lmu.de, 2014.[6] Machine Learning Repository Iris. http://archive.ics.uci.edu/ml/datasets/iris, 1988.[7] Machine Learning Repository Seeds. https://archive.ics.uci.edu/ml/datasets/seeds,

2012.

(1) Department of Computer Science, Babes-Bolyai University, 1 M. Kogal-niceanu Street, 400084, Cluj-Napoca, Romania

E-mail address: [email protected]

E-mail address: [email protected]

Page 88: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 86–86

MOISIL BOOLEAN FUNCTIONS SIMPLIFICATION

METHOD USED FOR SUMMARY EXTRACTION FROM

TEXT

ANDREEA-DIANA MIHIS (1) AND MIHAELA LUPEA (1)

Abstract. The problem of summary extraction from text is a classicalNatural Language Processing problem. Usually the summary is obtainedby selecting a set of sentences by using different criteria: key words cov-erage, similarity or informativeness. By considering a single statement, itcan fulfill a set of requirements. If it is to use a Greedy approach, theselected statements will be the ones which fulfill the maximum number ofunfulfilled requirements until all the requirements are fulfilled. But thisdoes not guarantee that the optimum solution is obtained. In this paperwe have used a method inspired from the Moisil Boolean function sim-plification method in order to generate the summary. The idea is thatfor each requirement all the statements which fulfill it are grouped. Fromeach group only one sentence will be selected. So each group can be seenas a disjunction of terms (a clause). And to the full text a large logicalpropositional is associated, a proposition which is in the Normal Conjunc-tive Form. Using distributive laws, the proposition is transformed intoNormal Disjunctive Form. And from this form the smallest conjunctiveterms (cubes) will provide the minimum number of statements which willgenerate the summary.

(1) University Babes-Bolyai of Cluj-Napoca, Faculty of Mathematics andComputer Science, Department of Computer Science, 1 Kogalniceanu Str., RO-400084, Cluj-Napoca, ROMANIA

E-mail address: [email protected]

E-mail address: [email protected]

2010 Mathematics Subject Classification. 03B65, 68T50.1998 CR Categories and Descriptors. code [Topic]: Subtopic – Detail ; code [Topic]:

Subtopic – Detail .Key words and phrases. summary, logic, natural language processing.

c©2015 Babes-Bolyai University, Cluj-Napoca

86

Page 89: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 87–90

CATEGORIZING AESTHETIC PHOTOS FROM LARGE

PHOTOGRAPHY COLLECTIONS USING SVM

AMALIA GOIA (1), ADRIAN STERCA (2), AND RARES BOIAN (3)

Abstract. In this paper we propose a SVM (Support Vector Machine)for classifying aesthetic photographs from a large photography collection.We propose a set of image features that assess the aesthetic quality of aphoto.

1. Introduction

Given the accessibility of digital cameras and the increasing variety ofportable devices such as smart phones and tablets, nowadays everybody canbecome an aspiring photographer. However, out of the photos that can befound on a regular photography website or in the collection of every suchwannabe-artist, a significant amount are of low aesthetic quality. Hence, thethe goal of this paper is selecting the high-quality photos from a large pho-tography collection in an automated manner. Categorizing a photography asaesthetic/professional or unaesthetic is a highly subjective task. In this workwe train a SVM in order to classify a photography as aesthetic or not aes-thetic. In order to train he SVM, we develop a set of image features that triesto quantify the aesthetic quality of a photo.

The earliest mention of Support Vector Machines goes back to 1979, butthe first main paper was introduced by Vapnik and Cortes in 1995. SVM hasattracted growing interest in classification due to the fact that its performanceis highly competitive to those of other algorithms for the task at hand (e.g.Artificial Neural Networks). Viewing the given input data as a set of vectorsin an n-dimensional space, this learning system performs a separation of theminto two classes, finding an optimal separating hyperplane (which has dimen-sion n-1). The optimality refers to a separation without errors and which

Received by the editors: ...2010 Mathematics Subject Classification. code, code.1998 CR Categories and Descriptors. code [Topic]: Subtopic – Detail ; code [Topic]:

Subtopic – Detail .Key words and phrases. SVM, image features.

c©2015 Babes-Bolyai University, Cluj-Napoca

87

Page 90: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

88 AMALIA GOIA, ADRIAN STERCA, AND RARES BOIAN

assures a maximum distance between the closest vectors to the hyperplane(i.e. maximizes the margin between the two data sets). The case when thedata is linearly separable is rare in real-world scenarios, so SVMs bring thenotion of a “kernel induced feature space” for casting the data into a higherdimensional space where the data is linearly separable. Overall, besides beingintuitive, SVMs are well-founded from a theoretical point of view and haveshown to be practically successful.

2. Related work

In [1], authors try to divide the photos into high quality professional ones(assumed to be taken by qualified, experienced photographers) and low qualitysnapshots like the ones every smart phone possessor can take. They base theirapproach on designing features which reflect the perception of a human beingtowards what differentiates between a professional image and a snapshot.

Another approach is presented in [2], which tries to explore the connec-tion between the emotions triggered in people and the low-level content ofphotographs. This results in the extraction of visual features taking into con-sideration the intuition of how much they can help discriminating betweenaesthetic and visually displeasing photos. Relying on low-level visual featuressolely, besides distinguishing between highly aesthetic and low visual valuephotographs, they also attempt building a regression model that can performa prediction of their aesthetic score. Their definition of high and low is basedon ranges in the scores of the images they collect from a peer-rating photog-raphy website.

Considering maybe the largest group of photograph-generating people, thehome users, [3] addresses a separation between the images taken by the previ-ously mentioned category and experienced photographers. A set of low-levelfeatures which relate both to high-level semantic concepts that would describethe photos and to general-purpose ones is explored and then, using two differ-ent schemes, the most discerning from them are given to the classifier.

A paper demonstrating another effective method for estimating aestheticsis [4], which uses high level attributes which describe images like compositionalones, referring to the image layout, content attributes and photo illumination(given by the light conditions). The method is also used for predicting howinteresting a Flickr photo will be considered by a viewer.

In [5], the authors expose the challenges faced in the inference of visualaesthetics in an algorithmic manner. They attempt to define the tasks thatresearchers of the topic have to solve, given the so-called aesthetics gap whichthey defined as the difference between the information that can be extracted

Page 91: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

CATEGORIZING PHOTOS FROM LARGE PHOTOGRAPHY COLLECTIONS 89

from low-level visual data and the emotion and aesthetic value perceived bythe viewer.

3. SVM for Categorizing aesthetic photos

The SVM algorithm is a classical SVM using Sequential Minimal Op-timization which breaks the optimization problem into several optimizationproblems and a polynomial kernel. The SMO algorithm first picks two train-ing points, optimizes this working set of two points and then checks if theKarush-Kuhn-Tucker given conditions hold for all training points. If they do,the algorithm terminates.

We use a set of four features for training the SVM and classifying photos.The first feature computes the degree of blurriness in the photography, know-ing that in good photos the subject is always sharp. Blurred photos are causedby camera shake, poor equipment, poor setup. We first divide the photo into3 equal columns and compute the sharpness level separately in each of these3 columns. The sharpness level is computed by applying a 7x7 Gaussian win-dow on each pixel from the photo column section and computing the sums ofabsolute differences between the actual picture color and the color of the pixelafter the Gaussian window is applied. The feature is equal to the maximumsharpness value from the 3 photo column sections.

The second image feature is the contrast of the photography. Knowingthat low contrast ones look washed out, we compute the contrast of the imageas a combination of the Michelson contrast formula and the Root Mean Squarecontrast formula.

The third image feature quantifies the compliance of a photo to the ruleof thirds. With the Rule of thirds, the photographer breaks down the photointo thirds, horizontally and vertically so that you have nine equal parts. Themain subject is not placed in the middle of the frame, thus it looks dynamic,moving and interesting. We first compute the edges in the photo using Cannyedge detector. The value of this feature is the maximum number of edge pointsfrom the left and the right column (part) of the photo, thus valuing photoswhere the subject is placed on the left or right column and not in the middle.

The fourth feature measures the spatial distribution of edges. We computethe edges using Canny edge detector. Cluttered images have a more uniformdistribution than professional ones. In order to compute this feature we dividethe image into 64x64 pixels blocks and measure the edge density in each ofthese blocks. If the pixel density in each of these blocks is similar, the pictureis considered non aesthetic.

Page 92: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

90 AMALIA GOIA, ADRIAN STERCA, AND RARES BOIAN

References

[1] Y. Ke, X. Tang, and F. Jing, The design of High-Level Features for Photo Quality As-sessment, In Proceedings of Computer Vision and Pattern Recognition, 2006.

[2] R. Datta, D. Joshi, J. Li, J.Z. Wang, Studying Aesthetics in Photographic Images Usinga Computational Approach, In Computer Vision ECCV 2006, pages 288-301, 2006.

[3] H. Tong, M. Li, H-J. Zang, J. He, C. Zhang, Classification of Digital Photos Taken byPhotographers or Home Users, In Advances in Multimedia Information Processing PCM2004, pages 198-205, 2004.

[4] S. Dhar, V. Ordonez, T. L. Berg, High level describable attributes for predicting aestheticsand interestingness, In CVPR ’11 Proceedings of the 2011 IEEE Conference on ComputerVision and Pattern Recognition, pages 1657-1664, 2011.

[5] R. Datta, J. Li, J.Z. Wang, Algorithmic inferencing of aesthetics and emotion in naturalimages: An exposition, In the 15th IEEE International Conference on Image Processing,pages 105-108, 2008.

(1) Babes-Bolyai University, Cluj-NapocaE-mail address: [email protected]

(2) Babes-Bolyai University, Cluj-NapocaE-mail address: [email protected]

(3) Babes-Bolyai University, Cluj-NapocaE-mail address: [email protected]

Page 93: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 91–91

ARTIFICIAL NEURAL NETWORKS APPLIED IN

ARCHAEOLOGY

DIANA LUCIA MIHOLCA (1)

Abstract. The two of the fundamental tasks in both bioarcheaology andforensic research are gender detection and stature prediction applied tohuman skeletal remains, the purpose of our research being their approachfrom a machine learning perspective.

In this direction we propose two artificial neural network models, themultilayer perceptron and the radial basis function network.

The archaeological data is often imprecise, its distribution and innerrelations being both complex and unknown. Consequently, the two abovementioned tasks are non-trivial, with increased probability of error espe-cially if the studied osteological remains are scarce or very ancient. So,a need to develop tools that can cope with the lack of information, com-plexity, and imprecision emerges. Among such methods, computationalintelligence techniques and, particularly, machine learning methods are ef-fective tools for archaeological data mining.

The main motivation for approaching the two bioarchaelogical tasks byapplying machine learning based data mining models is, however, theirability to capture relevant but unobvious inner patterns.

The proposed models are experimentally evaluated on multiple casestudies generated from data sets publicly available in the archaeologicalliterature and the obtained results are discussed and compared with theresults from other similar studies, outperforming most of them.

The obtained performances prove that the proposed data mining mod-els are effective for detecting the gender or estimating the stature of thearchaeological remains, confirming the potential of our proposals.

(1) Department of Computer Science, Babes-Bolyai University, 1 M. KogalniceanuStreet, 400084, Cluj-Napoca, Romania

c©2015 Babes-Bolyai University, Cluj-Napoca

91

Page 94: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 92–92

APPLIED COMPUTATIONAL INTELLIGENCE

TECHNIQUES

VLAD-SEBASTIAN IONESCU (1)

Abstract. In this PhD, we aim to research applications of machine learn-ing to the fields of social network analysis and archaeology.

Social networks have become a central part of most people’s lives inrecent years, with simple individuals, politicians, companies, news outlets,administrations and small businesses having an increasingly stronger on-line presence. This rise in popularity and usage has led to a tremendousincrease in the volume of data generated in online mediums such as socialnetworks, forums, chat rooms and news sites. Content is no longer gener-ated by a select few and consumed by the masses, it is now generated bythe masses, for the masses. This shift in the way information flows meansthat there is a lot of data to be harvested for all kinds of information:detecting the sentiment of people towards current issues, learning to pre-dict various events, learning who is most influential with regard to certaintopics and identifying anonymous authors.

We plan to use machine learning techniques applied on data taken fromvarious social networks in order to bring substantial contributions to theproblems of authorship attribution, sentiment analysis and anomaly de-tection in social networks. All of these are new research directions in thecontext of social networks, but they have a lot of activity and a lot of roomfor innovation.

Archaeology is an established discipline that studies data left behindby past populations. In this field, our applications of machine learninginvolve stature prediction and gender classification. Both of these areknown to give researchers insights into the culture and society of pastcivilizations. Machine learning has not been seriously applied to this fieldso far, so we think there is a lot of room for improvement. Our preliminaryexperimental results are significantly better than the existing state of theart, thus confirming the potential of applications in this field.

(1) Department of Computer Science, Babes-Bolyai University, 1 M. KogalniceanuStreet, 400084, Cluj-Napoca, Romania

E-mail address: [email protected]

c©2015 Babes-Bolyai University, Cluj-Napoca

92

Page 95: KEPT 2015 KNOWLEDGE ENGINEERING PRINCIPLES AND · PDF filekept 2015: knowledge engineering: principles and techniques cluj-napoca (romania), july 2, 2015, pp. 5{8 using static analysis

KEPT 2015: KNOWLEDGE ENGINEERING: PRINCIPLES AND TECHNIQUESCluj-Napoca (Romania), July 2, 2015, pp. 93–93

AN APPLIED OPTIMAL PACKING ALGORITHM WITH

CONSTRAINTS

ATTILA ZOLDE (1)

Abstract. We present an optimal packing algorithm that we implementedto help Ecolor (a supplier company for IKEA) to pack trucks efficiently.Optimal packing problems are well known and have been studied before,but for real-life applications the solution should also follow several con-straints based on maximum total weight, maximum weight on the frontaxle, stability of the packed items under transport and other pre-writtenrules of packing such as not placing heavier items on top of lighter itemsand ease of packing with the forklift.

As a solution for this constraint satisfaction problem the program con-tains a well formulated algorithm for branch elimination to satisfy thecostumers requests. Our software provides an optimal solution in a shorttime and allows for easy manual correction when it is necessary.

(1) Department of Computer Science, Babes-Bolyai University, 1 M. KogalniceanuStreet, 400084, Cluj-Napoca, Romania

E-mail address: [email protected]

2010 Mathematics Subject Classification. 68W25, 41A29, 68N19.1998 CR Categories and Descriptors. G.1.6 [Mathematics of Computing]: Numerical

Analysis – Constrained Optimization.

c©2015 Babes-Bolyai University, Cluj-Napoca

93