Computers ind. Engng Vol.22, No. 4, pp. 501-517, 1992 Printedin GreatBritain.
DESIGN
OF FOR
0360-8352/92 $5.00+0.00 PergamonPresspie
A KNOWLEDGE-BASED STATISTICAL PROCESS
EXPERT SYSTEM CONTROL
CHUEN-SHENG CHENG! and NORMA F~cas HUBELE2 ~Department of Industrial Engineering,Yuan-Z¢ Institute of Technology,Taoyuan Shian, Taiwan 32026 R.O.C. and 2Industrial and Management Systems Engineering, Arizona State University, Tempe, AR 85287-5906, U.S.A. (Received for publication 8 January 1992)
Abstract--A comprehensiveexpert systemdesignis presented for all problem-solvingaspects of statistical process control. Issues concerningthe integrationof monitoring,interpreting,diagnosing,planning,and statistical consultingfor statistical process control are addressed. All aspects of the expert system are discussed. In addition, a new similarity measure useful in a clustering approach to the knowledge organization is proposed. An example session is presented which diagnoses a cyclic pattern in a surface-finishingoperation.
I. INTRODUCTION The process problem-solving tasks involved in statistical process control (SPC) include interpretation of statistically designed control charts, diagnosis of deviated processes, and taking corrective actions. However precise the machine may be, no two products will be identical. This may result from tool wear, machine wear, differences in material, and environmental factors. The aim of SPC is not only to bring the output of the process into specification but also to reduce the variation of the process. Process problem-solving is frequently very difficult considering the complex interactions of manufacturing parameters. Frequently, the expertise required to direct the selection and application of problem-solving techniques is difficult to find. In this paper, we propose one possible solution approach, an expert system (ES) that combines numerical computations with the expertise of specialists in statistics and manufacturing processes. Waterman [1] and Hayes-Roth et al. [2] aptly describe the major capabilities of ES in capturing perishable expertise, exhibiting reasoning skills, and providing non-numerical solutions to problems, as well as furnishing an explanation of the derivation process of the solution. Hayes-Roth et al. [2] categorize ES into ten areas as a function of the type of problem addressed: interpretation, prediction, diagnosis, design, planning, monitoring, debugging, repair, instruction, and control. These categories also serve as guidelines in determining whether or not a particular application is suitable for ES development. The major component areas of SPC are very similar to the 10 ES areas, and make it a prime candidate for ES development. They are: (1) Monitoring: the continuous comparison of process data with predefined process performance standards (e.g. randomness), (2) Interpretation: the inference of process status (i.e. in-control or out-of-control) based on specific product and process information, (3) Diagnosis: the investigation of sources of process variation, (4) Planning: the preparation of remedial action or compensation to bring the process into a state of statistical control, (5) Prediction: the forecasting of future states (i.e. in-control or out-of-control) from existing data. (6) Instruction: the training of operators to learn more about the process and SPC techniques. We propose an ES construct capable of automatically identifying the out-of-control situations, revealing the sources of variation, and suggesting further actions. The system will use statistical knowledge along with process and product characteristics in SPC problem-solving. Some statistical 501
502
CmnsN-SI-mNGCI-IENGand NORMAFARTSHUBELE
knowledge can also be included in the system to help the user select and implement SPC process-improvement techniques. The anticipated advantage is that the drawbacks in human problem solving can be avoided and the system may function independently of human intervention. Furthermore, it is envisaged that an ES with explanation capability would provide users with an intelligent training/learning environment as well as serving as a tool to provide useful managerial information. Formally, the proposed knowledge-based system would be designed to perform the following two tasks:
(1) Solve problems The knowledge of process interpretation, disturbance diagnosis, and remedial action planning are included in the ES. The problem-solving task can be expressed as: Given: Information regarding product quality measurements and process information, such as input, output, and process parameter values (e.g. machine setting or tool). Goals: • To interpret the process status. • To fit data into known "out-of-control" categories if abnormalities were detected. • To find probable causes of deviation. • To recommend treatment methods.
(2) Train and learn Training in the proposed system is implemented in the form of statistical consultation. The user may query the system for an appropriate SPC technique or data analysis method. Based on the user-supplied information, the system has the intelligence to recommend an appropriate technique or method. In addition to the specific training capability of the proposed system, the learning can also be accomplished in the problem-solving sessions. SPC, by itself, is a learning process. Knowledge about the process and possible causes of process variation are both recorded. Efforts focus on preventing the occurrence of the same special causes of variation. Since the ES would include knowledge provided by experts in the different domains and this knowledge is explicitly coded in the system, the ES can justify its conclusions to the user (operator). The chain of reasoning which produced a certain conclusion is also outlined. Additionally, the ability of an ES to learn from experience increases its usefulness for future problem solving. Thus, the system would eventually provide a training and learning environment for personnel. An ES for SPC must have certain features to accomplish these tasks. Some of these features are common to ES while others are specific to the SPC domain. First, the proposed system should be designed effectively and quickly within operational time-critical constraints, perhaps beginning with a small subset of products and processes. Second, it should be able to evolve, that is, easy to modify and update. Modification and updating of knowledge is thus essential because, in an SPC domain, process and product knowledge might change rapidly. To ease modification and updating, a function for knowledge acquisition should be incorporated into the ES. This is to ensure that the knowledge base can easily be kept current, complete, and accurate. As discussed in Section 3, the knowledge base may be updated without altering the inference engine. Third, it should have the capability of integrating various problem-solving functions (e.g. interpreting/monitoring, diagnosing, and planning) into a single system. Fourth, the system should have a capability of accessing conventional algorithmic software systems (e.g. Fortran, C). This feature is critical to SPC due to the computational nature of statistics. Fifth, the system should have a Data Base Management System (DBMS) or have the capability to interface with a DBMS for storing information about the process/product. Sixth, and last, the ES should contain many user-friendly features such as a menu, help facilities, question, and some natural language capabilities. An ES is not just a set of rules that are processed to determine a solution. An ES must incorporate user-friendly features in order to make it easier to use, thus allowing smooth implementation. The principal tools in SPC are control charts which are essentially time plots of process or product characteristic values. In Cbeng and Hubele [3] a framework for a rule-based deviation recognition system in SPC is presented. Figure 1 depicts the configuration of this system which
Design of a knowledge-basedexpert systemfor statisticalprocess control
__Sctions_~
503
Process
,1
Process deviation recognition mechanism
Pattern recognition
H
Decision rules
l
Out-of-control signal
User
]
User interface
Knowl edge-based expert system Fig. 1. Flowchartof process deviationreasoning[3]. includes a pattern-recognition algorithm (problem domain independent) and a set of decision rules (problem dependent). The objective of the process deviation recognition is to identify when the product or process characteristic exhibit out-of-control behavior. This output initiates a warning signal to the user or operator that the process is in an out-of-control status. The expert system, by analyzing the knowledge base and querying the user, would signal deviated processes and explain the causes of variation. In this paper, we extend the prior work and concentrate on the important features of the ES design and knowledge organization. While most of the issues are common to all expert systems, we discuss the salient features of the system as they relate specifically to the problem-solving application for SPC. Although there are numerous charting techniques that could be included in the system, most of the examples discussed will involve plots of averages (X-bar charts) and ranges (R charts). In addition, we address the need for fast retrieval of information and the characteristics of the SPC environment by proposing a new similarity measure useful in a clustering approach to the knowledge organization. A complete illustrative example is also given of a sample session built using the proposed design. We begin our discussion with a description of other related works in expert systems. 2. OTHER RELATED EXPERT SYSTEMS Though ES have been applied to other domains for some time, little work has been done in SPC. Evans and Lindsay [4] develop a prototype ES using the commercial shell EXSYS to perform analysis of out-of-control situations in an X-bar chart. This prototype system requires the users to input the observed patterns, the type of charts, etc. Several important issues, such as the consideration of product and process characteristics in identifying the out-of-control situations and the path to determine the specific cause and corrective action, are not adequately addressed in this prototype system.
504
Cm~N-SSL~GCrmNo and NOgMAF~ausHUBELE
Alexander [5] describes a broad conceptual framework of the application of ES to manufacturing process control. The components described briefly in this framework include detection, diagnosis, correction and prediction of quality problems. The concepts for using product and process information for problem-solving are generally discussed. However, he does not address knowledge organization in depth. Dagli and Stacy [6] developed a prototype ES for selection of control charts. It is structured to select an appropriate control chart based on information such as the characteristic to be measured, subgroup sizes, and production rates. Kamal [7] proposes a framework for building a quality-prediction ES that would predict product quality prior to actual production. The approach incorporates knowledge and rules from both multivariate regression analysis and domain knowledge. Recently, Hosni and Elshennawy [8] described a theory and procedure for a knowledge-based quality control system. The main features include methods for determining the type of control chart to be used and suggesting the cause of process misbehavior. Out-of-control signals which are similar in principle to run tests and zone tests are related to possible causes, such as a shift, a trend, or a change of process variation. The suitability of associating out-of-control signals (e.g. two out of three close to a control limit) with possible causes (e.g. shift in process parameter) is not clearly addressed. Furthermore, some critical features, such as diagnosis of assignable causes and planning of corrective actions, are not included. We now continue with a discussion of a comprehensive architecture for the proposed system. 3. ARCHITECTUREOF THE KNOWLEDGE-BASEDEXPERT SYSTEM In the design of the knowledge-based system for SPC, several key issues require consideration.
1. Integration of problem-solving functions Solving the problems of SPC generally requires a variety of diverse functions. Some of the functions are best performed using conventional programming techniques. Other functions, such as expert level evaluation, might require specialized knowledge or expertise and be solved by an ES. For instance, determining an unnatural pattern requires numerical computing and would be implemented in a traditional algorithmic program. On the other hand, determining whether an unnatural pattern indicates an out-of-control state requires specialized expertise. The ES proposed here is an embedded system in which the mathematical program (e.g. pattern-recognition algorithm) works as the major component and accesses the ES when a particular type of information is required [9]. Cheng and Hubele [3] recommended that a pattern-recognition algorithm be used to continuously monitor the process data, and that any unnatural pattern detected works as the driving force of the ES component. The knowledge base for each problem-solving task is stored in a modular structure. The problem-solving modules included in the ES are: interpreting/monitoring, diagnosis, planning, and statistical consulting. Each functional module may have multiple knowledge bases (partitioned knowledge base) to acount for the nature of different processes. The knowledge modules will be loaded into memory and accessed by means of a menu selection when needed. The monitoring/interpretation module is designed to recognize circumstances when the process is in an out-of-control state. The monitoring module compares observations with predefined process performance standards (e.g. control limits, randomness). It attempts to clarify or explain the situation which the process represents (i.e. a random process or a non-random process); any unnatural pattern exhibited in the collected data is identified by the pattern-recognition algorithm described in Cheng and Hubele [3]. The interpretation module determines whether the unnatural pattern exhibited in the collected data represents an out-of-control state. The diagnosis module relates observed process irregularities to underlying causes. When the process monitoring/interpretation modules detect an out-of-control pattern, the process diagnosis module begins to identify and locate the special disturbance in order to restrict its effects, and to facilitate recovery. The diagnosis module consists of three steps, i.e. cause identification, hypothesis
Design of a knowledge-basedexpert systemfor statistical processcontrol
505
generation, and hypothesis verification. The task of cause identification is to indicate the deviation category to be diagnosed using the detected pattern as a clue. The task of hypothesis generation is to invoke some hypothesis about the detail sources of deviation; the task of hypothesis verification is to confirm or reject these hypotheses. This task may include the simultaneous consideration of several quality characteristics. The main goal of the planning module is to formulate a remedial plan for the causes of variation identified in the diagnosis module. Generally, an action analysis might require the analytical tools such as regression analysis or experimental designs. The on-line tutorial module provides information for SPC problem-solving techniques, for implementing an approach, and for referring the user to appropriate sources of information. Statistical consulting will help the user in choosing the appropriate form of SPC techniques and selecting data analysis methods. These last two modules will eventually serve as the training facility in an SPC domain.
2. Selection of programming languages Choosing an appropriate tool for building a particular ES is a difficult yet crucial task. The prominent consideration involves matching the problem characteristics to necessary tool features. In the prototype example built in this research, numerical computation is implemented in C, while the expert-level reasoning is written in Prolog. The suitability of using Prolog for implementing ES has been addressed by various researchers [10-12]. The commonly cited advantages of Prolog include built-in inference engine, pattern-matching, and search procedures. Turbo Prolog was selected as the programming language. Turbo Prolog is a true compiler marketed by Borland International [13] for the IBM PC and compatible computers. The main reasons for choosing Turbo Prolog (version 2.0) as the programming language in this application was the ease with which the rules can be written, ease of handling data, and the built-in search chaining mechanism. Turbo Prolog also provides a functional interface with other languages making it possible for the user to combine routines from Prolog and other languages (such as C) in a single system. In addition, Turbo Prolog provides direct access to any computer port to input and output data, making it easy to develop real-time systems.
3. Knowledge acquisition Figure 2 provides a detailed diagram of the proposed system architecture. Each box represents a set of programs which interface with the user, the expert, and the process/product data (pattern-recognition algorithm). The solid arrows indicate the flow of control in the system and the dashed arrows show how information is passed between programs and data bases. In SPC, the knowledge required for quality problem solving can be accumulated from experienced operators, handbooks, documentation, and other resources. The knowledge can be classified into two categories. One is the theoretical knowledge which can be acquired through textbooks or published literature (i.e. deep knowledge). The other kind is the heuristic, experimental knowledge which comes from the expert (i.e. shallow knowledge). The shallow ES approach tries to directly capture the relationships between irregularities in process behavior and process deviation. The knowledge required in this type of ES consists of empirical associations between the symptoms of deviation and the deviations themselves. In the contrast, a deep-knowledge ES attempts to exphcitly capture the underlying principles of a domain. The ES discussed here is a combination of a shallow and a deep knowledge-based system. The knowledge to interpret process data might include statistical rules and be classified as deep knowledge. On the other hand, diagnosis and action-planning knowledge may be shallow in nature. Knowledge pertaining to a specific problem can be classified as either declarative or procedural knowledge. Declarative knowledge is the knowledge which defines the problem domain and a specific problem, such as a fact. It can be generated at the beginning of a session by questioning the user, by accessing an existing data base, or by receiving a digital stream of information directly
~
-~ Flow of control
jJ
Process information
Product information
L. . . . . . . . . . . . . . . . . . . .
I
',
l
I--I I .... I I I I
~----
algorithm (Turbo C program)
Pattern r e c o g n i t i o n
t
I
i Data
I I I
PROCESS
\
~.
....
dialog
--
I I I I I
I =
uest - -
Initial state
System status Temporary facts
Working memory (Turbo Prolog
nowledge - - -1
I I ~ K JR e q
I
1
~i
.,O---~ ~
-~--.
tJ
Request upoa~lng . . . . . . . .
-,,
Explanation (what) . . . . . . . .
--Jl. . . .
(Turbo Prolog b u i l t - in editor)
(attribute i, explanation i)
...........................
What-type explanation (attribute 1, explanation 1)
inow"e'cu'sit'°n I
EXPERT
---1 I --i .......
Fig. 2. Overall system architecture.
Question for attributes
Table of a t t r i b u t e s J
Rule
e x t e r n a l file)
(Turbo Prolog
K n o w l e d g e base
I
Inference engine (Turbo Prolog main p r o g r a m )
Menu-driven
f'
Answer/why/who explanation Request
-~- Flow of information
Known facts
L
|
~
m
°
"
o
Question
USER
Query ! Response/What
Warning (an unnatural pattern) ==
Load static data base
;=
rA
t=
Design of a knowledge-basedexpert system for statistical process control
507
from a set of sensors. In the current domain, facts could be the observations describing the present status of the process. One set of facts might be: PROCESS TYPE M A C H I N E I.D. MEASUREMENT PART NO. PART ATTRIBUTES
: : : : :
ABRASIVE P/N G R I N D I N G SPEED S U R F A C E SPEED TEMPERATURE HUMIDITY OPERATOR LEVEL
: : : : : :
Surface grinding G1245 Surface finish 14200 SHAPE LENGTH MATERIAL OUTER DIA. TOLERANCE 98700 1500 rpm 4500 fpm 90°F 15% High
: Round : 15 in. : Cemented carbide : 5 in. : +0.001 in.
Note that the above information is also called the known facts which are the initial conditions of the problem to be addressed. Declarative knowledge could also comprise a set of rules that include process knowledge and statistical knowledge used to describe the problem domain. For example:
Process knowledge /f
the measurement is concentricity or flatness or surface finish or squareness or parallelism then only upper control limit is used in the control chart.
Statistics knowledge /f
the population is skewed in such a way that the long tail is on the high side (positive skewness) then there will be a positive correlation between X-bar and R charts. Procedural knowledge can be described as the domain specific problem-solving knowledge. For instance:
Statistics knowledge /f
pattern is a linear trend and the observations of this trend pattern are above the center line then the process is out-of-control. Some dominant principles, such as an R chart should always be interpreted before the corresponding X-bar chart is interpreted, can also be classified as procedural knowledge.
4. Knowledge representation A structured, rule-based scheme is chosen to represent knowledge in SPC. In a rule-based system, all knowledge is expressed as rules or facts. In this system, the basic component of a rule is the fact defined by an attribute and value pair. The general format is as follows: relationship(attribute,value). The statement "the detected pattern is a cycle" can be written in Prolog as is(' 'detected_pattern", "cycle"). where "cycle" is the value of the attribute "detected_pattern".
508
CHtnzN-Sx-mNO CI-mNG and
NORMAFARTS HUBELE
Associated with each fact in the rule clauses is a set of questions and a list of possible values of attributes. The questions are stored in the knowledge base and in the form: question(Attribute ,Text_to_be_Displayed). Example: question("detected_pattern","What king of pattern do you observe?"). The list of attribute values is also stored in the knowledge base. The format is in the form: table(Attribute,A_lisLof_Value). Example: table("detected_pattern",["trend","cycle", . . . . "mixture_pattern"]). In the ES developed in this research, the rules are coded in the knowledge base and stored in an external file. The knowledge base is loaded into a Turbo Prolog user-defined internal data base at the beginning of a consultation. The basic format of a rule is as follows: rule(Rule_No, Rule_Name,R0,[R~,R2 . . . . . Rn ] It is significant that this rule format is viewed as a "fact" in a Prolog language. The main reason to store the rule as a fact format is that Turbo Prolog allows access and manipulation of only those facts in an external file. We will further discuss the knowledge organization in the section following the description of the inference engine. 5. INFERENCE ENGINE---CONTROL/SEARCHSTRATEGY The inference engine includes a set of rules which are domain-independent and used to control the reasoning process. The inference rules are coded in the Turbo Prolog main program. These inference rules must be functionally separated from the production rules, making it possible to update the rule base without altering the inference engine. This module contains the control/search strategy of the system. It comprises seven submodules. Using statistical information and specific product/process characteristics together with a patternrecognition algorithm, the interpretation submodule determines whether an unnatural pattern indicates an out-of-control situation (see Cheng and Hubele, [3]). This sub-module is written in Turbo Prolog using a depth-first, backward-chaining strategy. The diagnosis submodule is designed to find all possible causes of a deviated process. The diagnosis procedure starts by generating a set of hypothesized causes of deviation which need to be investigated. The basic method for reaching a goal is to ask a specific set of questions in a consultation session with the user. The answers to the questions are used to build facts which are stored in a Prolog dynamic data base. The facts, in turn, are used to trigger and fire rules that express the relationships between the various known facts and between the facts and new conclusions. As the rules fire, the conclusions are added to other existing facts and conclusions in working memory (the dynamic data base). Eventually, the system will either reach the specified conclusions (goals) or admit that it cannot reach a conclusion based on the information available. Using pseudo code, the above procedure can be represented as: perfomLdiagnosis([]) if!
/*Done, all possible causes have been verified*/
perform_diagnosis([Hypothesis IRescof_hypotheses) if diagnosis(Hypothesis), perform__diagnosis(ResCo f_hypotheses).
/*Hypotheses set*/ /*Verify the first cause*/ /*Find other causes*/
diagnosis(Hypothesis)if inference(Hypothesis,_), rule(_,Content,Hypothesis,_)!, assert(possible_causes(Content). diagnosis(_) if!.
/*Verify the premises of the rule*/ /*Find the content of the cause*/ /*Add conclusion to dynamic data base*/ /*The available information does not support the hypothesis*/
Design of a knowledge-based expert system for statistical process control
509
The planning submodule employs a combination of forward and backward search strategies. Forward-chaining is employed initially to obtain a hypothesis about the possible remedial plan. Backward chaining is then used to verify the hypothesis. The procedure is repeated until all possible plans have been identified. In forward chaining, the input data is scanned and the program attempts to get a low-level goal to succeed. Once this occurs, the conclusion is added to the data base and an attempt is made to get a higher-level goal to succeed. Eventually, a final conclusion should succeed. The statistical consultation sub-module helps the user to choose the appropriate form of SPC techniques and data analysis methods. It is part of the inference engine and uses a backward chaining strategy.
6. Domain independent components Working memory (also known as data memory, global data base) contains facts that describe what is known about a particular problem. Dynamic data base is the working memory in a Prolog program. It is used to store the information like facts acquired from the user, intermediate results, conclusions, and static known facts from a data base. When a program is started, working memory is either empty and contains no knowledge or it might include some known facts describing the initial state of the problem. As the consultation progresses, the system learns more about the problem, and new knowledge is put into working memory. The knowledge in the working memory is used to fire additional rules. As each rule fires, the conclusion is added to the working memory with the facts already known. Similar to working memory, the data base contains the necessary information for problem solving. However, the information acquired from the data base will not change during the execution. In other words, this information is static. The information contained in the data base might be the information regarding the process, e.g. machine, material, etc. This data base is queried by the user at the beginning of a consultation. Specific product and process information are loaded into the working memory and treated as known facts. The usefulness of an ES depends on ease of usage, ability of the ES to explain and advise and the strength of its reasoning. It should incorporate user-friendly features such as menus, help facilities, questions, error-tolerant capacity, multi-window interface, and some natural language capabilities. 4. A NEW SIMILARITY MEASURE FOR KNOWLEDGE ORGANIZATION
Occasionally, the raw knowledge might be expressed only as a very specific link between observed attributes (i.e. part attributes, process characteristics, process symptoms, etc.) and a final decision [i.e. specific cause(s) and action(s)]. This type of knowledge is often referred to as surface or shallow knowledge. In the current application, the elements of knowledge can be classified into five categories: Let Et = the part attributes. = {design attributes, manufacturing attributes, functional attributes, etc.} E2 -- process characteristics.. -- {those attributes that constitute the processes} = {machine parameters, material type, method, operator level, environment} = {cutting speed, feed rate, fixture, temperature, humidity, etc.} E3 = quality measurements. = {concentricity, surface finish, parallelism, diameter, etc.} E4 -- out-of-control symptoms. --{upward trend, cycle, shift, etc.} E5 -- types of quality measurements. = {mean, range, etc.} E -- set of categories of antecedents, premises, evidences, or conditions. --{E,, E2, E3, E4, Es}
510
Cnu~q-Sm~lqGCm~NGand NO~ttAFAreSHunEl~ H = set of consequences, conclusion, hypothesis, or actions. = causes or remedy actions to eliminate process deviation.
A heuristic rule could be conceptually expressed in the following generic form IF
E' (subset of E)
THEN
H ' (subset of H)
One of the major difficulties of a shallow-knowledge approach is that the knowledge requirements are unstructured and may be broad in scope. This situation frequently occurs when knowledge is from documented experience without any structured organization. The reasoning knowledge may be tied to the process symptoms, part attributes, process characteristics and quality measure. The complexity often makes the knowledge search procedure very long if the knowledge is not well organized. As a consequence, the knowledge base will include a large amount of knowledge linking the complex combination of part attributes and process characteristics. In addition, the raw knowledge from domain experts might be incomplete, might conflict, or be redundant due to a complex set of parameters required to describe the knowledge. In this regard, the problem of organization of knowledge becomes of paramount importance in large knowledgebase domains. The goal of knowledge organization is to try to partially summarize and categorize subsets of the knowledge and thus allow a process deviation reasoning system to reason from initial data to final conclusion in an orderly manner. In the current domain, for example, it is desired to reach an intermediate conclusion, "machine problem," and then using some other observed data to reach a very specific decision, "worn tools". The significant advantage of organizing knowledge in this manner is that it allows the reasoning to proceed in fewer steps. Abstractly, the task of knowledge organization is to FIND:
Rules of the form Observed data ~ Intermediate Conclusion and Intermediate Conclusion ~ Final Conclusion
GIVEN:
Raw knowledge of the form Observed data ~ Final Conclusion
The knowledge organization in the above form has been referred to as "learning from observation" or more specifically "learning intermediate concepts" [14-16]. By concept, it refers to a cluster of production rules in a how-type knowledge structure or a frame in a what-type structure. An intermediate concept in SPC domain, for example, would be "when part attributes = X and process = Y there usually is a machine problem". This clustering of production rules has been used, for example, by PROSPECTOR which is an ES built to predict the location of ore deposits [17]. That system uses a Bayesian approach to estimate probabilities associating hypotheses to evidence. The PROSPECTOR approach is similar to the proposed approach in that evidence from the five categories described above is used to associate similar evidence to support intermediate rules. The contribution of the proposed approach is the development of a new similarity measure which takes into account the fact that some categories of evidence have more rules associated with them than others. For instance, two complex parts may look very dissimilar but undergo the same processing steps and be subject to the same process deviations. In this regard, their similarity measure should be very high. This concept will become clearer with the example that appears at the end of this section. Some commonly cited advantages of a well-organized knowledge base include [14-16]: efficient storage and retrieval of knowledge, concise (logically suflieient) description of knowledge (i.e. a sufficient set of antecedents and consequences in a production rule), summaries of raw knowledge that serve as an aid in knowledge refinement and induce new knowledge, and a mechanism for explanation. Knowledge of process deviation may be represented in an associative tree structure to achieve the above advantages. Causes of process deviation can be organized to form a hierarchical structure, starting from the top level with most general causes, and proceeding to the bottom level with most specific causes. The advantage of knowledge organization in the current domain is that it can provide some useful managerial information. By counting the number of times a rule has been invoked, a
Design of a knowledge-basedexpert systemfor statistical processcontrol
511
summary of the current process problems can provide useful information for managerial decision making. For example, what type of operations and processes are sensitive to the machine problems? This important feature could be included in an explanation mechanism to provide the user a clear understanding of the deviated process. In addition, a well-organized knowledge base also allows ease of knowledge modification in SPC domain. It is not unusual that the process knowledge might change with time (e.g. process change) or new knowledge might be acquired. Knowledge organization allows change of the relevant concepts without altering the entire knowledge base. A machine learning technique known as learning from instruction [15] might be used to transform and integrate the new knowledge into the existing knowledge structure. Clustering concepts are employed here to bring together similar rules and help organize diagnostic knowledge to form a consistent, concise, and complete knowledge base. Clustering in this application and context is usually viewed as a process of partitioning data into groups of similar objects. The problem-independent components applied to this SPC domain include: (1) Specifying the set of objects to be clustered, the raw knowledge from domain expert(s) or production rules, (2) Specifying the set of relevant attributes (variables) to be used in describing objects such as process symptoms, part attributes, process characteristics, cause(s) of deviation and/or actions to eliminate cause(s) of deviation, (3) Specifying the method of encoding variables, (4) A principle for grouping objects into clusters, such as a similarity or distance measure of production rules, (5) The inter-cluster structure, which may be a partition structure, overlapping structure, hierarchical structure, or bipolar structure. Problem-dependent components are: (6) A cluster representation scheme which defines the means for normally representing clusters, e.g. a cluster might be represented by nodes in a classification tree or by conjunctive statements. (7) A representation function determines the representation of an object in a certain cluster, (8) An allocation function determined the cluster to which an observed object belongs, (9) A clustering optimality criterion defines the optimal clustering of objects, e.g. a measure of fit. Conceptually, the task of knowledge organization would include the following steps [15, 18]:
Knowledge Aggregation: determining patterns in raw knowledge (classes of rules), determining a general taxonomic description characterizing each class of knowledge, forming a set of mutually distinguishable classes of rules. Knowledge Characterization: determining the sufficient attributes to distinguish a given class from a fixed number of other classes. The major concern in the current domain is the knowledge aggregation problem. The first task in knowledge aggregation includes an estimation of similarity measure between each pair of rules. The aim of a similarity measure is to provide a logical estimate of sameness among qualitative data and to serve as in input to clustering analysis. There are several measures available for calculating the similarity coefficients in terms of individual elements. The major concern with using a similarity measure in the current situation is that it should be applied to categories of elements, rather than individual elements since a measuring bias may be produced due to a large number of elements in a certain category (e.g. part attributes might contain many more elements than others). The misuse of a similarity measure can be illustrated by the following example: Assume Rule A is described by 16 elements of Category 1 data, two elements of category 2 data, and two elements of Category 3 data. On the other hand, Rule B is described by 18 elements of Category 1 data, one element of Category 2 data, and one element of Category 3 data.
512
CHt~N-SH~GCHUG and Nor.~ FAg]SHUa~L~
Define % = the number of elements common to both rule i and j. flu = the number of elements present in rule i but absent in rule j. ?u = the number of elements present in rule j but absent in rule i. Based on a commonly used similarity measure [19], the similarity beween rule i and j can be defined as S,s =
+
Suppose there are 16 Category 1 elements present in both A and B (ct^s = 16) and nothing common in Category 2 or Category 3. T h e n , / ] ~ = 4 (i.e. 0 + 2 + 2) and ?AB = 4 (i.e. 2 + 1 + 1). Then rule A and B would not be judged similar, providing that each category carries the same weight in describing the rule. However, the similarity measure shows that these two rules are quite similar. The similarity measure S ~ is computed as SAs = 16/(16 + 4 + 4) = 4/6 which is a very high degree of similarity. To avoid the above measuring bias, a distance measure which is modified from Lee's [20] weighting distance is proposed to fit the current problem domain. A dissimilarity coefficient is first computed for Rule i and j in category k. An aggregate distance measure will then be computed from the dissimilarity coefficients of each category. The final distance measure represents the distance of categorized data instead of individual item. Let R~ = ~ijk = /3ijk = 7~jk= ;(~ =
production Rule i. the number of elements common to both Rule i and j in Category k. the number of elements present in Rule i but absent in Rule j in Category k. the number of elements present in Rule j but absent in Rule i in Category k. set of elements that constitute k th category of production Rule i.
Define the dissimilarity coefficient between Rules i and j in Category k as 6(Z~, ZSk)= 1 -- Gt;~,/(~tiik + fli~ + ?ljk) The distance measure between Rules i and j could be defined as N kffil
where
Wk = weight of the k t~ categorized data
=~ LO
2
liffil j-i+l ~(zik'zjk)
if the 6(X~, Xjk)s are not all equal to 0
otherwise
and N is the number of categories. M is the total number of production rules. To better understand this algorithm, consider the following example problem containing three rules. Those items belonging to the same category are enclosed with parentheses. Let
Rl---(ete2),(e,),(eT) R2 -~ (ele2),(es),(eT) R3=(e3),(e6),(eT)
Design of a knowledge-based expert system for statistical process control
513
Therefore,
~0~,,, 3~2,)
1 2/(2 + 0 + 6(~21, X31) = 1 - 0/(2 + 1 + 6(XH, X3t) = 1 - 0/(2 + 1 + 6(X12, X22) = 1 -- 0/(0 + 1 + 6(Z22, X32) = 1 -- 0/(0 + 1 + 6(X12, ~32)= 1 - 0 / ( 0 + 1 + =
- -
O) = 0) = 0) = 1) =
1) = 1)= 6(Z~3, Z23) = 1 - 1/(1 + 0 + 0) = 6(~23, X33) = 1 -- 1/(1 + 0 + 0) = ~(~13, ~33) = 1 - 1/(1 + 0 + 0) =
0 I 1 1 1 1 0 0 0
and wl = ~ / ( 0 + w2=~/(1
1 + 1) = 1.5 + 1+ 1)= 1
W3 = 0
Note that the largest weight w~ takes into account that Rule 3 does not have a common element in the first category of either Rules 1 and 2. The distance measures are calculated as follows d(Ri, R2) = 3/2(1) + 1(1) + 0(0) = 1 l(1) + 0(0) ----5/2 d(R2, R3) = 3/2(1) + 1(1) + 0(0) = 5/2
d(Ri, R3) = 3/2(1) +
Based on this distance measure, Rule 3 has the least number of common elements among the three rules. The above discussion illustrates a new similarity measure in knowledge aggregation. It can be fed directly into a clustering algorithm in performing knowledge organization. Returning to our overall architecture depicted in Fig. 2, the driving force of the system is the deviation recognition algorithm. The output would be a signal of a nonrandom pattern to the user. The user might consult the ES for deviation reasoning. The user then would load the data base containing the product and process information at the beginning of consultation. This information is then stored in the working memory. The user would consult the ES through a menu-driven dialog. The inference engine selects the appropriate rules from the knowledge base, which are stored in the external file, to solve the problem. The intermediate results or conclusions are stored in the working memory. The contents of "what" explanation are stored in an external help file to assist the user understand a query. The explanation mechanism might select appropriate rules to present the "why" explanation during the consultation session. At the end of the consultation, the system displays the conclusions and the path of reasoning using the information stored in the working memory. Updating or modification of the knowledge base can be done by the knowledge acquisition subsystem. 5. EXAMPLE SESSION
Consider an example session using this architectural design to diagnose a turning lathe process. The quality characteristic of interest is the surface finish of the bushing. It is assumed that range data are in-control while the observed out-of-control pattern in the average data is a cycle. The possible causes of a cyclic pattern include merging of different processes, different incoming material, periodic rotation of operators, measurement devices, seasonal effects, and change of machine setting. In the metal-cutting process, the influential factors affecting surface finish include: cutting speed, feed rate, cutting tool, and cutting material. In the following illustration, the detected pattern will serve as the basis for determining the direction of deviation diagnosis. The statements in { } tell the reader some background information. The bold-face text is issued by the system. The user responses are in italics.
514
~ - S ~ n B N G CHENG and NORMAFARISHUBELE
{Start} {known facts: Is('control_scheme','X-bar and Range'), is('qu ality_characteristic','surface_finish')} {System generates the hypothesis of "seasonal effect'} What kind of pattern was detected in the range data ? [cycle, freaks, grouping, instability, Interaction, mixture, shift_in_level, none
stratification, systematic, trend, {Range data have to be diagnosed first}
none]
What kind of pattern was detected in the average data ? [cycle, freaks, grouping, instability, interaction, mixture, shift_in_level, stratification, systematic, trend, none]
cycle What kind of sampling method do you use ? [instant_time, period_time] ESC key, what {User triggers the explanation facility} {System displays the following information to describe the term "sampling method" (terminology)} SAMPLING METHOD
A fundamental idea in the use of control chart is the collection of sample data according to the concept of rational subgrouplng. There are two approaches for rational subgrouping: instant-time method and period-time method. In the first approach, each sample consists of units that were produced at the same time (or as closely together as possible). It minimizes the chance of variability within a sample, and maximizes the chance of variability between samples if assignable causes are present. In the second approach, each sample consists of units of product that are representative of all units that have been produced since the last subgroup was taken. Essentially, each sample is a random sample of all process output over the sampling interval. Press F-lO to continue
What kind of sampling method do you use ? [instant_time, period_time] instant._time {Systemresumes the query of sampling method} What is the sampling rate ? [hourly_basis, lO_mln, 3O_mln] Esc, why {User triggers the explanation facility} {System displays the following English-like explanation (procedural knowledge}} WHY Because I need this feet in order to prove the rule: possible_cause is seasonal_effect if R_chart_in_control is yes end detactad_patlem_X Is cycle and samplingmethod is instant_time
Design of a knowledge-based expert system for statistical process control
and
sampling_rate is houdy basis
and
period_of_cycle is 8
Press F-lO to continue
What is the sampling rate ? [hourly_basle,
lO_mln,
30_min
{System resumes the query of sampling rate}
30_mln]
{The above facts do not support the hypothesisof seasonal effect} {System ignores the query of period of cycle}
{System generates the hypothesis of difference between shifts} When do you observe the problem ? [current_shift,
current.shift
more_then_one_shift] {This fact eliminates the possible cause of difference between shifts}
{System generates the hypothesis of multiple streams} Does process Include multiple streams ? [yes,
no]
Eso, what
{User triggers the explanation facility} {System displays the following information to describe the term "multiple streams" (terminology and declarative knowledge)}
MULTIPLE STREAMS A process with multiple streams can be defined as 8 machine with multiple spindles; multiple machines; multiple measurementsfrom the same part, etc. If measurements from different streams are statistically different (i.e., with different process mean and variance), some unnatural patterns such as cycle, mixture might be detected In the process data. One possible solution is applying a control chart to each stream. Press F-IO to continue Does process include multiple streams ? [yea, no] {System resumes the query of "multiple streams'} no {This fact eliminates the possible cause of merging different processes} {System generates the hypothesis of vadation due to upstream operation} DO parts come from more than one source ? [yes, no
no] {This fact eliminates the variation due to previous process}
{System generates the hypothesisof change of machinesetting} Is there any change In machine setting recently? [yes, no]
yes CAIE 22/4~K
{System tries to verify the cause of change of machine setting}
515
516
CHUEN-SHENG ~ o
and NORMA FARm Htm,~.s
Is there any change In holding device ? [yes,
no]
Is there any change in cutting tool ? [yes,
no]
Is there any change in feed rate ? [yes, no
no]
Is there any change in cutting speed ? [yes,
no]
no
{The above facts do not support the hypothesisof change of machine setting, other changes might not effect surface finish}
{System generates the hypothesis of rotation of operators} Is there any change in machine operator ? [yes, no
no]
Are products inspected by more than one inspector ? [yes, no] no
{The above facts do not support the cause of periodic rotation of operators}
{System generates the hypothesis of material variation} Ooes process Include more than one lot of material ? [yes,
no]
yes
Is there any difference In raw material ? [yes,
no] {There are more than one lit of material end some of them
yes
are different} {The above facts support the cause of material variation} {System tries to verify other causes} {System generates the hypothesis of measurementdevice} is there any change in measurement device ? [yes, no
no] {The above fact does not support the cause of measurementdevice} {System reaches the end of diagnosis} Diagnosis Results The possible_cause might be merging_of_different_material Press F-IO to continue {System displays the possible cause}
Design of a knowledge-based expert system for statistical process control
517
6. SUMMARY AND FUTURE RESEARCH DIRECTION
In today's highly competitive environment, the need to increase quality and productivity, while simultaneously decreasing cost, is of major concern to all successful organizations. Statistical process control has proven itself over the past 40 years as both a management philosophy and a collection of problem-solving techniques. Persistent out-of-control problems are the results of common root causes. To effectively use SPC, a sequence of methodical problem solving steps should be followed. This involves gathering information about both process and product characterisics, and correctly applying the appropriate statistical technique for diagnosis, analysis, and corrective action. The design of a knowledge-based system was proposed as an alternative to the traditional human-directed information-gathering and problem-solving approach of SPC. The proposed system would be capable of detecting process deviation and of assisting the user in determining the cause of the out-of-control situation. The final output from the system would be a prioritized list of corrective actions. The system could play the role of an intelligent assistant or consultant to operators in a manufacturing environment. In our discussion, the critical importance of process and part data was addressed with the introduction of a new similarity measure for knowledge organization. The example session given in Section 5 was taken from an actual functioning computer program and illustrates the usefulness of the system in synthesizing information, directing the user to relevant problem-solving information, and finally, providing direction for corrective action. A comprehensive system would include a very large knowledge base and inference engine with numerous statistical modules to perform relevant analysis. In addition, an inexact reasoning mechanism might be added to deal with incomplete, inexact or uncertain data. Finally, a complete implementation of this system could include links to measurement devices through transducers and signal processors to provide real-time applications. Acknowledgement--The authors gratefully acknowledge Hughes Missile Systems Group of Tucson, Arizona for their support of this research. REFERENCES 1. D. A. Waterman. How do expert systems differ from conventional programs? Expert Syst. 3, 16-19 (1986). 2. F. Hayes-Roth, D. A. Waterman and D. B. Lenat (Eds.) Building Expert Systems. Addison-Wesley, Massachusetts (1983). 3. C.-S. Cheng and N. F. Hubele. A framework for a rule-based deviation recognition system in statistical process control. In Int. Industrial Engineering Conf. and Societies of Manufacturing and Productivity Symp. Proc., Toronto, Canada, May 14-17, pp. 677-682 (1989). 4. J. R. Evans and W. M. Lindsay. Expert systems for statistical quality control. In Int. Industrial Engineering Conf. and World Productivity Forum Proc., Washington, D.C., May 17-20, pp. 567-572 (1987). 5. S. M. Alexander. The application of expert systems to manufacturing process control. Computers Ind. Engng 12, 307-314 (1987). 6. C. H. Dagli and R. Stacy. A prototype expert system for selecting control charts. Int. J. Prod. Res. 26, 987-996 (1988). 7. M. A. Kamal. Building expert systems in statistical process control. In Proc. 1988 ASME Int. Computers in Engineering Conf., San Francisco, California, July 31-August 4, pp. 71-77. 8. Y. A. Hosni and A. K. Elshennawy. Knowledge-based quality control system. Computers Ind. Engng 15, 331-337 (1988). 9. R. G. Bowerman and D. E. Glover. Putting Expert Systems into Practice. Van Nostrand Reinhold, New York (1988). 10. P. A. Subrahmanyam. The software engineering of expert systems: is Prolog appropriate? 1EEE Trans. Software Engng, SE-II, 1391-1400 (1985). 1I. D. G. Bobrow. If Prolog is the answer, what is the question? or what it takes to support AI programming paradigms. IEEE Trans. Software Engng SE-11, 1401-1408 (1985). 12. N. C. Rowe. Artificial Intelligence Through Prolog. Prentice-Hall, Englewood Cliffs, New Jersey (1988). 13. Borland International. Turbo Prolog 2.0 User's Guide (1988). 14. L.-M. Fu and B. G. Bushanan. Learning intermediate concepts in constructing a hierarchical knowledge base. In Proc. 9th Int. Joint Conf. Artificial Intelligence, Los Angeles, California, August 18-23, pp. 659-666 (1985). 15. R. S. Michalski. A theory and methodology of inductive learning. Artificial Intell. 20, 111-161 (1983). 16. Y. Cheng and K.-S. Fu. Conceptual clustering in knowledge organization. IEEE Trans. Pattern Analysis Machine lntell. PAMI-7, 592-598 (1985). 17. E. Charniak and D. McDermott. Introduction to Artificial Intelligence. Addison-Wesley, Reading, Massachusetts (1986). 18. D. Fisher and P. Langley. Approaches to conceptual clustering. In Proc. 9th Int. Joint Conf. Artificial Intelligence, Los Angeles, California, August 18-23, pp. 691-697 (1985). 19. M. R. Anderberg. Cluster Analysis for Application. Academic Press, New York (1973). 20. R. C. T. Lee, Clustering analysis and its applications. In Advances in Information System Science (Edited by J.-T. Tou). Plenum Press, New York (1981).