Download Journal of Computing Web-Based Expert System for Classification of

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Volume 2 No.6, JUNE 2011
Journal of Emerging Trends in Computing and Information Sciences
ISSN 2079-8407
©2010-11 CIS Journal. All rights reserved.
http://www.cisjournal.org
Web-Based Expert System for Classification of Industrial and
Commercial Waste Products
1
2, 3
Joseph O. Dada, 2Hans-D. Kochs, 3Joerg Petersen
1
School of Computer Science, University of Manchester, UK
Fakultät für Ingenieurwissenschaften Universität Duisburg-Essen, Duisburg,Germany
[email protected]
ABSTRACT
Industrial and commercial wastes must be classified at least two times on the way from the owner of the waste to the waste
disposal facility in order to ensure that waste handling is in conformity with the law. Wastes classification as dangerous
goods is very difficult because they consist of many components with diverse dangerous properties. This paper presents a
Web-based expert system we developed for the classification of wastes to overcome this difficulty. It joins the expert
system intelligent knowledge and the capability of the Web to put the knowledge of experts anywhere the expert can’t go.
The system uses a set of if-then rules to classify waste.
Keywords— Web-based Expert System, Waste Classification, Knowledge Base, Knowledge Programming
1. INTRODUCTION
Industrial waste must be classified at least two
times on the way from the owner of the waste to the waste
disposal facility in order to ensure that waste handling is in
conformity with the law. The classification takes place
first of all when allocating the waste key number
according to the “Europäische Abfallartkatalog – (EAK)“
[1] in the context of the creation of the disposal proof, and
secondly with the allocation of packaging and transport
regulations in accordance with “Gefahrgutverordnung
Straße und Eisenbahn (GGVSE)” [2]. Since GGVSE is
only designed for pure substances and compound
substances with limited number of pure substances as
components, the classification of wastes as dangerous
goods is up till now very difficult because they consists of
many components with diverse dangerous properties. The
dangerous properties also depend very much on the waste
production process i.e. waste origin.
Expert Systems are computer programs, which
attempt to reach a level of performance by means of
solving problems comparable to that of a human expert in
some specialized application domain [3]. Presently the
Web has turned into the most widely means of
dissemination of knowledge throughout the world. Expert
system, which emulates the behaviour of human expert,
must be present in the Web. Here we present a Web-based
expert system for the classification of wastes according to
EAK and GGVSE based on the branch specific expert
knowledge. The main objective of the system is to join
the expert system intelligent knowledge and the capability
of the Web to put the knowledge of experts anywhere the
expert can’t go. The most significant characteristic of the
system is that it is Web-based, that is, it runs over the
Internet. The user can interact with the system Web site
any time anywhere to classify waste. Web is the ideal
medium to make the expert knowledge available anywhere
any time. The user will contribute information about the
origin, the compositions and other characteristics of the
waste for the classification of production-specific waste.
The classification follows a stepwise process where waste
is considered to be a preparation consisting of several
components (i.e. physical and chemical compounds), each
of them contributing to relevant waste properties.
For the classifications, a set of standard output
parameters describing the industrial waste is used. The
output parameters can either be taken from the system
database or is analytically determined. The system
combines information received from the user through the
Internet with the information in the database for the
purpose of classification.
The rest of the paper is organized as follows. In
section 2, we describe the waste classification method.
This is followed by the description of the expert system
development in section 3 and the system structure in
section 4. Section 5 presents the results and discussion,
and the conclusion is presented in section 6.
2. WASTE CLASSIFICATION METHOD
Industrial and commercial waste classification is
based on laws [1], [2], [4], [5], [6], [7]. The regulations for
the classification, which are contained in the laws, must be
interpreted and formulated into decision rules by experts.
The domain experts based on the rule syntax for writing
rules developed the classification rules. The classification
rules are organized in a tree like structure. The tree
represents the conceptual structure of classification rules
as shown in figure 1. There are three kinds of nodes in the
tree: Root, Node, and Leaf. Root is the starting point of the
knowledge base. Node represents one section of
laws/regulations. Law section may have many subsections, as shown in the diagram. Leaf means final result
will be made at that part of the law. Each classification
rule corresponds to a node in the tree structure [8].
Beginning at the Root, the inference goes through every
257
Volume 2 No.6, JUNE 2011
Journal of Emerging Trends in Computing and Information Sciences
ISSN 2079-8407
©2010-11 CIS Journal. All rights reserved.
http://www.cisjournal.org
node in the tree, so that a complete search is achieved. We
used forward chaining, Depth First Search strategies. The
search route is illustrated in figure 1 by a dashed line. The
rules determine the preparation’s dangerous properties,
transport class properties, and precedence of hazards etc.
of a given waste.
Laws/regulations
Root
Node
Leaf
Figure 1: Structure of classification rules [9]
The starting point for the waste classification is
the extraction of facts – preparation (i.e. waste) with
properties and compositions – from database. Facts are
then saved in the working memory. Rules are applied upon
these data. As soon as some rules fire, new facts (data)
will be derived by rules during the classification process.
These new facts (data) will also be saved in the working
memory. The rule will be applied on the updated data, and
derive again new facts. The process goes on and on, until a
limit has been reached. This limit is: the rules have
examined all the properties involved in GGVSE or EAK
classification. The classification rules determine basically
the preparation’s dangerous properties, transport class
properties, and precedence of hazards etc. of a given
waste. The classification results to be presented to the
users contain all or some of the following information:
•
•
•
•
•
•
•
•
•
•
Class
Classification code
Packaging group
Technical description
Hazard code
UN no.
Label and
Hints, remark for the classification according to
GGVSE
EAK-Code
EAK Identifier and
•
Hints for the classification according to waste
law.
3. EXPERT SYSTEM DEVELOPMENT
The main components of an expert system are the
knowledge base and the inference engine, which are
invisible from the outside world. The inference engine is
able to infer conclusions or solutions from the knowledge
base, based on the user-supplied or stored facts. The user
interface requests information from the user and outputs
results with explanation. The inference engine implements
the reasoning mechanism or capabilities.
An expert system requires a precise domain. The
domain must be well organized and well understood [10].
The knowledge base (KB), which is the core component of
any expert system, is problem-domain specific and stores
the encoded knowledge acquired from an expert in the
field to support the inference about problems. Normally, a
knowledge engineer is responsible for working with an
expert to build the knowledge base for the system. The
knowledge engineer must perform a details analysis of the
inference process and develop the knowledge base. The
major tasks involved in developing our knowledge base
include knowledge acquisition, knowledge representation
and knowledge programming.
3.1
Knowledge
Representation
Acquisition
and
The main objective of the knowledge acquisition
is to obtain facts and rules from the experts that will allow
the system to draw expert level conclusions. This process
is very difficult and time-consuming, especially if the
knowledge engineer is not familiar with the domain. After
the acquisition of the knowledge begins the encoding of
the expert knowledge into the proper format for the
computer. This involves encoding and representation of
the facts and relationships that constitutes the knowledge.
As mentioned earlier, we used IF-THEN styles for the
representation of the knowledge. In our case, we
developed a Web-based user interface module for the
domain experts to allow them enter rules and basic facts
about the wastes.
The rules and facts are based on the transport
regulation, waste law, and waste branch specific
information and production process. The domain experts
can monitor and automatically test the execution of the
expert system in Web browser before deployment for the
users. We achieved this with the help of Java based Rule
Compiler and Inference Engine modules which are briefly
described below.
258
Volume 2 No.6, JUNE 2011
Journal of Emerging Trends in Computing and Information Sciences
ISSN 2079-8407
©2010-11 CIS Journal. All rights reserved.
http://www.cisjournal.org
3.2 Knowledge Programming – The Rule
Compiler
In the knowledge programming stage, we first
analysed the rules and facts from the domain experts.
From the analysis, it was clear that object oriented
approach [11] using Universal Modelling Language
(UML) [12] can be applied to the rule-based expert
system. We developed the UML model of rules. Based on
the UML model and Operators/Keywords also derived
from the rule syntax, we developed the rule Grammatik
that we used as input to the Java Compiler Compiler
(JavaCC) [13] to generate a Rule Compiler. The Rule
Compiler (RC) then takes the rules from the experts and
automatically generates each rule as Java source code. The
source code is then compiled into Java Byte Code using
Java compiler. Figure 2 shows the steps involved in
developing the RC for automatically generating Java Byte
codes from rules.
The working memory is a cache that stores all
facts/data about the preparation or waste. The
classification rules are stored in a Java package; each rule
is a Java class. During the run-time, the engine will
instantiate rules as objects, and execute them by an object
method invocation. The engine also carries out the
inference based on the rules. The engine loads data about a
preparation (waste) from database and applies
classification rules on it to achieve a classification result.
The Knowledge Base (KB) Servlet Module that serves as
communication interface between the users and the expert
system is described in section 4.
Figure 3: Inference engine for the expert system
4. SYSTEM STRUCTURE
Figure 2: Overview of the steps involved for the development
of rule compiler and for generation of knowledge base
module from the Law
3.3 Inference Engine
The inference engine (Figure 3) implements the
functionality of the knowledge base. An inference consists
of three stages: matching, conflict resolving and
execution. The inference engine has a working memory, a
repository of classification rules, and it executes the rules.
The system (Figure 4) consists basically of 5
main components/modules: System Database, Expert
System, Servlet Web Interface Module and Database
Tables Interface Module. These components/modules are
briefly explained in this section.
Servlet Web Interface Module (SWIM)
implements the Web interface for the system. Users use
the Web browser to communicate with the system. SWIM
establishes the communication and interchange
information between the system and the users through the
Web browser. It maintains and controls the flow of data
between the user and the system. SWIM is based on Java
Servlets Technology. Servlets are applications running on
the Web server to manage client’s requests [14]. The
Servlet serves as interface between the remote user and the
inference engine through the Web server. The
communication between the Web browser (client) and the
Apache Web server used in our project is over a Secure
Socket Layer (SSL) i.e. HTTPS. Since the system is
multi-users system, there is need to manage individual
session. We achieved this with help of Servlet session
tracking. When a user makes a request, a session ID is
created for the user, which identifies the user throughout
user interactions with the expert system.
259
Volume 2 No.6, JUNE 2011
Journal of Emerging Trends in Computing and Information Sciences
ISSN 2079-8407
©2010-11 CIS Journal. All rights reserved.
http://www.cisjournal.org
classes and the inference engine. The two components
have been explained in section 3. The inference engine
uses the DTIM to communicate with database and KBServlet module (explained above) to communicate with
the users through a Web browser.
5. RESULTS AND DISCUSSION
We have implemented a prototype of the system.
The rule compiler is implemented in Java language, an
object-oriented language. The compiler parses and
translates rules into Java classes. Figure 5 and 6 show a
sample rule used in the system and the Java source code
for rule generated with the compiler.
The inference engine takes the facts about the
waste and applies rules on it to obtain classification
results. The classification knowledge base is based on
laws and regulations. We used forward chaining, Depth
First Search strategies. The rules determine the
preparation’s dangerous properties, transport class
properties, and precedence of hazards etc. of a given
waste. When a rule fires, it modifies facts in the working
memory, returns a value, or call other rules for further
determination.
Figure 4: System Structure
There are three categories of users: The domain experts,
the system administrator and the general users. SWIM
consists of 3 sub-modules: Knowledge Acquisition (KQ)
Servlet, Knowledge Base (KB) Servlet and Administrator
(AD) Servlet modules) for each of the user categories. The
general users use Knowledge Base (KB) Servlet to interact
with the expert system. The user begins consultation with
the expert system using Web browser. In some part of the
consultation the expert system could need information
from the users, when user gives the information, the expert
system modifies its working memory and stores this value
that will be available until the end of the consultation. The
KB-Servlet module handled the Web server interactions
with the inference engine. The domain expert uses the
KQ-Servlet module for interacting with the system while
the system administrator uses the AD-Servlet module for
system administration through a Web browser.
The system database consists of data and facts
about the waste and laws. We used relational database for
the persistence layer as stated above but the programming
language used is object-oriented. The Database Interface
Module (DTIM) implements the object-oriented interface
for the relational database. It interfaced the expert system
module and the SWIM to the database. DTIM uses Java
Database Connectivity (JDBC) [14] for connection into
the database.
The expert system module consists basically of
two components; the knowledge base compiled into Java
RULE FlashPoint_prep
AREA D
IF
NOT PROPERTY FLAMMPKT EXISTS
AND
CompFlashPoint() = TRUE
THEN
SET PROPERTY FLAMMPKT =
Min_FlashPoint();
PHRASE
Figure 5: Sample rule
Package Iska.IskaKB.Rules.ADR;
import java.io.*;
import java.util.*;
import Iska.IskaKB.Types.*;
import Iska.IskaKB.RuleEngine.*;
import Iska.IskaKB.*;
public
class
FlashPoint_prep
implements
BaseRuleBoolean, BaseClear {
private Hashtable Cache = new Hashtable();
private PreparationMemory GetPreparation = null;
public protocol myProtocol = null;
public FlashPoint_prep() {}
public
FlashPoint_prep(PreparationMemory
pM,
protocol p) {
GetPreparation = pM;
myProtocol = p;
}
public void OClearCache() {
Cache.clear();
}
260
Volume 2 No.6, JUNE 2011
Journal of Emerging Trends in Computing and Information Sciences
ISSN 2079-8407
©2010-11 CIS Journal. All rights reserved.
http://www.cisjournal.org
public TBoolean OCall(JPreparation JPrep) throws
IskaKB$ClassificationException {
return Call(JPrep);
}
public final TBoolean Call(JPreparation JPrep) throws
IskaKB$ClassificationException {
myProtocol.println("Rule FlashPoint_prep for " +
JPrep.StoffID + " called...");
//not yet cached => CallRule, put result to cache
if (! Cache.containsKey(JPrep.StoffID)) {
Cache.put(JPrep.StoffID,
new
TBoolean(CallRule(JPrep)));
CacheRules.AddRule(new FlashPoint_prep());
}
//else { System.out.println("cache active!"); }
//now it is in the cache!!
myProtocol.print("Rule FlashPoint_prep for " +
JPrep.StoffID + " called. ");
myProtocol.println("Result:
"
+
(((TBoolean)Cache.get(JPrep.StoffID))) );
return (((TBoolean)Cache.get(JPrep.StoffID)));
}
protected boolean CallRule(JPreparation Substance)
throws IskaKB$ClassificationException {
/* ID: */
/* Areas: D */
try {
if (
(
!( /* NOT */
(Substance.get("FLAMMPKT")).exists()
) /* NOT */
&&
compare.eq(
(new
CompFlashPoint(GetPreparation, myProtocol)).OCall(
Substance ) , new TBoolean(true) )
)
) /* if part */
{
Substance.put("FLAMMPKT",
(new
Min_FlashPoint(GetPreparation,
myProtocol)).OCall(
Substance ) );
GetPreparation.putPreparation(Substance);
return true; /* RULE TRUE */
}
else { return false; } /* boolean RULE FALSE */
} catch (Exception e) {
throw
new
IskaKB$ClassificationException("Exception in rules. " +
e.getMessage());
}
}
}
Figure 6: Java source code for the sample rule
FlashPoint_prep
6. CONCLUSION
We have presented a Web-based expert system
for the classification of industrial and commercial wastes
in this paper. Waste classification is not only a legal issue
but also has economic meaning. Appropriate classification
of waste provides a general improvement for work
protection during transportation, storage, disposal and
utilisation of the industrial wastes, as well as a promotion
of the exchange and spreading of information and
knowledge about the problems of the waste disposal and
recycling. Expert system, which emulates the behaviour of
human expert, must be present on the Web. We have
shown how this can be achieved in this paper.
The system permits expert to develop the
knowledge base through the Web interface and all changes
can be seen automatically at the same time they are done.
An interesting inovation of the work presented here is the
RC that autaomatically compiles the rules develop by
expart into Java code. Future work will be to extend the
knowledge base to other branches. We also want to adapt
the RC for use in other domains.
ACKNOWLEDGEMENTS
We acknowledge with thanks the financial support of
Deutsche Bundesstiftung Umwelt for the project work
presented in this paper. The first author would like to
thank Pedro Mendes, his present line manager at the
University of Manchester, UK.
REFERENCES
[1]
Verordnung
über
das
Europäische
Abfallverzeichnis (Waste Catalogue Code–AVV)
vom 1.1.2002.
[2]
Gefahrgut-Verordnung Straße und Eisenbahn
(GGVSE) vom 11. Dezember 2001.
[3]
N. M. Motto, An Approach to Knowledge Base
Management (Springer, Berlin 1991).
[4]
Richtlinie 1999/45/EG des Europäischen
Parlaments und des Rates vom 31. Mai 1999 zur
Angleichung
der
Rechtsund
Verwaltungsvorschriften der Mitgliedstaaten für
die Einstufung, Verpackung und Kennzeichnung
gefährlicher
Zubereitungen
(ersetzt
88/379/EWG).
[5]
Richtlinie 91/689/EWG über gefährliche Abfälle
vom 12. Dezember 1991, zuletzt geädert am 27.
Juni 1994.
261
Volume 2 No.6, JUNE 2011
Journal of Emerging Trends in Computing and Information Sciences
ISSN 2079-8407
©2010-11 CIS Journal. All rights reserved.
http://www.cisjournal.org
[6]
[7]
[8]
[9]
Entscheidung
2000/532/EG
zur
Abfallrahmenrichtlinie. Entscheidung über ein
Verzeichnis gefährlicher Abfälle vom 3. 2000.
Gesetzt zum Schutz vor gefährlichen Stoffen
(Chemikaliengesetz –ChemG) in der Fassung
vom 25. Juli 1994, zuletzt geändert am 8. Mai
2001.
J. O. Dada, H.-D. Kochs, J. Petersen; "IskaWeb:
A Web-Based Information System for the
classification of Industrial Wastes", Proceedings
of the International Conference on Internet
Computing, Las Vegas, USA, June 2004, pp.
617-623.
M. Ni, Concept of a Rule-Based Expert System
Module for a Database Information System for
Classification of Products and Wastes, Master
Thesis, Institute of Information Technology,
Faculty of Engineering, University of DuisburgEssen, Germany, 2003.
[10]
W.D. Potter, X. Deng, J. Li, M. Xu, Y. Wei, I.
Lappas, A Web-based Expert System for Gypsy
Moth Risk Assessment, Computers and
Electronics In Agriculture, Vol. 27, Issues 1-3,
200, pp. 95-105.
[11]
I. Graham, Object Oriented Methods (Reading,
Mass, Addison-Wesley, 1994).
[12]
G. Booch, J. Rumbaugh, I. Jacobson, The Unified
Modelling Language User Guide (Reading, Mass,
Addison-Wesley, 1999).
[13]
Java Compiler
Compiler
Compiler
Compiler
(JavaCC), Java
(JavaCC),
http://java.net/projects/javacc/
[14]
J. Hunter, W. Crawford, The Java Servlet
Programming (O’Reilly & Associates, Inc. CA,
1998).
262