PII:
SO308-521X(96)00066-2
A,qricrrltural S,wems. 53 (1997) pp. 325 ~348 1‘ 1997 Published by Elsevier Science Ltd Printed in Great Britain. All rights reserved 0308-521X)97 S17.00 +O.OO
ELSEVIER
A Methodology for Qualitative Modeling of Crop Production Systems R. E. Plant* Departments
of Agronomy and Range Science and Biological and Agricultural University of California. Davis CA 95616, USA
Engineering.
(Received 20 November 1995; revised version received I2 June 1996; accepted I9 June 1996) ABSTRACT This paper presents the inference algorithm for a qualitative modeling program called QTIP (Qualitative Temporal Inference Program). This program was developed for use in crop management decision support systems. The algorithm presented here is used to diagnose possible disorders leading to abnormal values in data collected as a part of the crop management process. QTIP employs rules representing cause and effect relationships to generate qualitative dynamic scenarios. Its diagnostic algorithm is a hypothetical reasoning scheme consisting of alternating applications of abduction, to identifypossible causes of observed conditions, and deduction, to maintain internal consistency. The algorithm is illustrated through application to a simple model for a hypothetical small grain crop. CJ 1997 Published by Elsevier Science Ltd. All rights reserved
INTRODUCTION Computer-based decision support systems have the potential to provide substantial benefits in crop production and management. The development of such systems is, however, considerably more complex and challenging than the development of decision support systems for some other applications. Agricultural crops are complex ecosystems influenced by a variety of factors, many of which are highly stochastic and unpredictable. Numerical simulation models (e.g., Lemmon, 1986; Ives et al., 1984) and expert systems (e.g., Goode11 et al., 1990; Saunders et al., 1987) are two methods that have *E-mail: replant@ ucdavis.edu 325
326
R. E. Plant
proven useful in the development of crop management decision support systems. Each of these works in a different way to use knowledge about general system properties to convert data taken from the system into information about the system that can be used in developing management strategies and tactics. The objective of the present paper is to provide a methodology that attempts to combine some of the most useful features of numerical simulation models and expert systems. This methodology is based on the “secondgeneration” expert system concept, originally introduced in the domains of applied physics and electronics (De Kleer & Brown, 1984; Forbus, 1984; Kuipers, 1984). Second-generation systems generally are based on the notion of a qualitative model of system dynamics, that is, one that employs, in the terminology of Stevens (1946) a nominal or ordinal scale (e.g., high, low, etc.), rather than the ratio or interval scale used to represent quantities in numerical simulation models. Qualitative models employ some of the features of numerical, or quantitative, simulation models, such as the explicit representation of dynamics and a more mechanistic, or abstract, representation of knowledge than is typical in “first-generation” expert systems (Kuipers, 1984). Because qualitative models use an ordinal scale, their solutions cannot be as precise as those of quantitative models. However, one of the premises in the theory of qualitative models (e.g., Kuipers, 1984, p. 170; De Kleer & Brown, 1984, p. 8) is that the reduced precision of qualitative models may make them more robust than equivalent quantitative simulation models because a single ordinal quantity may represent a broad range of ratio or interval values. Although a qualitative model can stand on its own in a decision support system, it can also be used as a complementary part of a mixed system. For example, a qualitative model may be coupled with a quantitative crop simulation model to provide explanation and interpretation of quantitative simulation results. A qualitative model may be linked to a “first generation” rule-based expert system as a blackboard (Plant er al., 1992) to integrate results from distinct crop knowledge bases. The methodology presented in this paper is implemented in a program called QTIP (for Qualitative Temporal Inference Program). It is based on logical inference using principles of cause and effect and uses inference instead of differential or difference equations to simulate the system dynamics. QTIP is motivated by work of Blalock (1969) who discussed principles of cause and effect in the formulation of sociological theories; of Starfield et al. (1989) and Starfield & Bleloch (1983), who first used logical rules to represent system dynamics in an ecological system; of Weiss et al. (1978), who incorporated varying levels of abstraction into a network of causal inference; and of Plant & Loomis (1991), who presented a preliminary version of the representation of cause and effect used in QTIP.
Modeling
crop production
systems
321
The intended application of QTIP is for agricultural crop production, but the methodology may in principle be applicable to other domains as well. QTIP is conceptually similar to systems in the medical domain such as INTERNIST/CADUCEUS (Pople, 1982) and CASNET (Weiss et al., 1978). In QTIP, cause-and-effect statements are encoded in rules analogous to the production rules of classical expert systems, but with the flow of causality carrying from antecedents to consequents. This is generally the reverse of the direction in most classical diagnostic expert systems, and represents a more natural encoding of knowledge. By adopting this representation, QTIP circumvents problems of “directionality” typically associated with rule-based expert systems (Peng & Reggia, 1990). These problems, familiar to many knowledge engineers, include the frequent need to mix arcane “control rules” with knowledge representation rules, the difficulty of representing context, and problems in diagnosing multiple disorders. The present paper describes the application of QTIP to diagnosis of disorders in an annual crop. The diagnosis is accomplished in the same way as is done when using a numerical crop simulation model, by comparing field data with corresponding simulated values. The present paper deals only with the QTIP algorithm for diagnosis of crop disorders. It does not discuss the procedure for creating an actual QTIP model, nor does it deal with the verification and validation of such a model. These will be considered in a later paper.
REPRESENTATION
OF QUANTITIES
In his development of a methodology for the formation of logical chains of cause and effect, Blalock (1969) points out the advantages of explicitly organizing levels of abstraction when developing a causal inference process. He describes several meanings that can be attached to the term “levels of abstraction”. These include a hierarchy of classes such as is now used in object-oriented programming (Stroudstrup, 1986) an element-class relationship reminiscent of semantic networks (Winston, 1984) and an “indicator” perspective in which abstract concepts are represented by measurable quantities. QTIP’s organization is based on the last of these three perspectives. It is similar to the three-fold hierarchy of levels of abstraction used by Weiss et al. (1978) in their causal network for glaucoma diagnosis. QTIP also uses a three-level hierarchy to represent the processes involved in crop production. These three levels are called field data, agronomic indicators, and ecophysiological state variables. Their relationship is shown schematically in Fig. 1. Field data represent the crop in the lowest, most empirical level of abstraction. They are the data, possibly in aggregated form, recorded directly from the crop and its environment. Field data include crop-based measure-
328
R. E. Plant
ments such as plant height, number of tillers or branches, and measures of harvestable material. In addition, field data can include environmental quantities such as temperature and soil electrical conductivity, as well as managementrelated quantities such as irrigation rates and fertilizer application rates. Because they are numerical quantities, field data are, in the classification of Stevens (1946), generally either ratio or interval quantities, although they may in principle be ordinal (i.e., categorical), nominal, or even binary (i.e., true/false). Agronomic indicators (AIs) occupy an intermediate level of abstraction. As their name implies, agronomic indicators are computed quantities that have been shown by agricultural scientists to represent important aspects of the state of the crop. Some aggregated field data may function directly as agronomic indicators, for example, plant height or irrigation rate. However, the management, or at least the scientific study, of most crops involves quantities having special significance in representing some aspect of the state of the crop. In general, these are algebraic combinations of field data items. Agronomic indicators are frequently identified by agronomists in the study of yield components. For example, in small grains, the number of filled kernels per spike or panicle is often related to the crop stress level (Anonymous, 1990). Since agronomic indicators are generally algebraic combinations of field data values, they are usually measured on a ratio or interval scale.
Association
Agronomic Indicators
Algebraic combination
Field Data
Fig. 1. QTIP hierarchy of levels of abstraction used to represent crop-related quantities. Field data are at the lowest level of abstraction and are quantities measured in the field. At an intermediate level of abstraction are agronomic indicators: algebraic combinations of field data used to represent agronomically important quantities. Both field data and agronomic indicators are measured on an interval or ratio scale. Ecophysiological state variables are measured on an ordinal scale and used to represent crop processes at the highest level of abstraction.
Modeling crop production systems
329
Ecophysiological state variables (ESVs) occupy the highest level of abstraction. ESVs are used to represent the relationships and interactions of the qualitative model. They may represent crop processes that are not observable, such as stress level and photosynthetic rate. In QTIP every agronomic indicator is associated with one ESV, so that agronomic indicators provide the bridge between crop data and the crop model. Generally ESVs that have an associated agronomic indicator simply express this quantity in a more abstract way. For example, if the irrigation rate is an agronomic indicator, then soil moisture level might be the associated ESV. ESVs are only allowed to take on ordinal or Boolean values. This represents the typical use of such quantities by experts in making diagnostic judgments. For instance, in reasoning about the crop, the expert would generally use information that the soil moisture level is too high (i.e., that the soil is saturated) rather than that the irrigation rate has a particular numerical value. To maintain the greatest possible level of simplicity in the initial QTIP implementation, we have tentatively established the convention that ESVs must take on one of three ordinal values: LOW, MEDIUM, and HIGH. In representing crop states by ordinal quantities, it is important to keep in mind a distinction which, by analogy with the terminology of economics (e.g., Just et al., 1982) we refer to as normative versus positive description. In the quantity space consisting of {LOW, MEDIUM, HIGH}, a normative interpretation of the term LOW is that it means “too low”, whereas a positive interpretation of this term carries no such connotation. For example, early season carbohydrate demand from fruiting structures is low relative to late-season demand. Therefore, when applied to the early season the phrase carbohydrate demand = LOW carries two different meanings depending on whether it is a normative or a positive statement. If it is a normative statement, it means that carbohydrate demand is “too low”, relative to current standards, and thus may invoke the diagnosis of an abnormal condition. If the phrase is a positive statement, it may be interpreted as describing the normal state of affairs relative to conditions later in the season. We have tentatively adopted the convention in QTIP that ESVs carry a normative interpretation in which the value MEDZUM is used to indicate normal, or acceptable, values. A more precise interpretation of the values LOW and HIGH is “sufficiently low (high) that yield will be improved by some particular action or actions on the part of the farmer”.
THE LOGICAL
REPRESENTATION
OF CAUSE AND EFFECT
The QTIP modeling methodology is based on a concept discussed by Plant & Loomis (1991). This is to retain the production rule structure of the first
330
R. E. Plant
generation expert system, but to incorporate causality into the direction of the production rules. In first generation diagnostic expert systems there is no indication of causality in production rules. When there is a causal relationship between phrases of a rule, it is often in the opposite direction of logical implication. That is, a typical diagnostic rule might have the form “IF the plant is wilted THEN the plant moisture content is too low”. In this case the flow of causality is from the consequent to the antecedent (low moisture causes the wilted plant). The same knowledge in the model of Plant and Loomis would be represented by the rule “IF the plant moisture content is too low THEN the plant is wilted”. A similar approach has been adopted by Guerrin (1991). The use of the term “cause” in QTIP is intended in the ordinary, colloquial sense that event A “causes” event B if the occurrence of event A occasions as a result the occurrence of event B. Causal rules are fundamentally asymmetric in that if A causes B then B cannot simultaneously cause A (Iwasaki & Simon, 1986). Because of this asymmetry, causality and logical inference, as used in rule-based expert systems, are not equivalent (Simon & Rescher, 1966). Coincidentally, Simon and Rescher provide an agronomic example of this nonequivalence: in the statement “If there is heavy rainfall then the wheat harvest will be good”, one may presume that the heavy rainfall caused the good wheat harvest. According to the rules of logic, the statement is equivalent to “If the wheat harvest is not good then the rainfall is not heavy”. However, one cannot state that the poor wheat harvest caused the low rainfall. Although causality and logical inference are not equivalent, they do share certain characteristics that can be exploited in the development of a methodology for qualitative modeling. In particular, they share the notion of modus ponens (Gensereth & Nilsson, 1987). That is, in logic if we make the statements “IF (x = a) THEN (y = b)” and “IF (y = b) THEN (z = c)” then given that x = a we may infer that z = c. Analogously, if we have the statements “x having the value a causes y to have the value b” and “y having the value b causes z to have the value c”, then x having the value a is an indirect cause of z having the value c. Blalock (1969) uses this to form chains of causal reasoning as a method for analyzing cause and effect in the social sciences. QTIP uses this same methodology. It consists of a collection of causal rules and a logical process for linking them in inference chains. Although making logical implication flow in the same direction as causality is a technically almost trivial adjustment in concept, it has several farreaching consequences. Among these are the following: (1) There is a natural association of causality with dynamics in that if event A causes event B then event B must occur no later in time than event A, and often A will occur measurably earlier. Therefore maintaining a single direction of flow of causality
Modeling crop production systems
331
ensures that this corresponds to the flow of time and makes the representation of system dynamics more efficient. (2) The use of causal rules simplifies the process of automated translation of production rules into natural language explanations by reducing the need for “control” rules that manage the flow of inference. (3) The use of causal rules permits the introduction of alternative forms of inference to those traditionally used in diagnostic, rule-based expert systems. In “first generation” expert systems, a rule such as “IF (x = a) THEN (y = b)” means “IF the value of x is a THEN set the value of y to b (i.e., bind b to y)“. One interpretation of this process is that the rules represent a set of instructions to the computer and inference is the determination of which instructions to follow. A second interpretation is that the rules represent knowledge and that inference is the logical process of deduction. Indeed, the confounding of “control” rules with “knowledge” rules in diagnostic expert systems is due the mixture of these two interpretations. Because of the second interpretation, we will refer to the use of this procedure in either forward or backward chaining mode as deductive chaining. The introduction of a causal interpretation for production rules in a qualitative model permits the development of a modified logical procedure that we will call abductive chaining. Abductive inference is compared to deductive inference by Charniak & McDermott (1984) as follows. Given the rule IF (x = a) THEN (y = b), deduction is the process of concluding that y = b based on the observation that x = a. Given the same rule and the observation that y = b, abduction is the process of concluding that it is possible that x = a (cf. the rainfall-wheat example above). Unlike deduction, abduction cannot be used to draw conclusions with certainty, but rather only to propose possibilities. Charniak & McDermott point out that abductive inference is often most successful when applied to statements of cause and effect. Abductive inference has been used in the medical domain by Pople (1982) and in the agricultural domain by Guay et al. (1992). The QTIP diagnostic algorithm uses knowledge of causality in the form of cause-and-effect rules to establish a diagnosis through abductive backward chaining inference. The difference between abductive backward chaining as employed in QTIP and ordinary deductive inference is as follows. Like deductive forward chaining, the abductive backward chaining process begins by establishing all available data values. Consider the following simple, two-rule base: RULE 1 IF (plant-moisture = low) THEN (leaf-wilt = high) RULE 2 IF (soil-moisture = low) THEN (plant-moisture = low).
332
R. E. Plant
Suppose the value of leaf wilt is established as high. Then, using Rule 1, the condition plant moisture = low can be established a possible cause. Applying backward chaining logic and invoking Rule 2, the condition soil moisture = low can be established as a possible cause of plant moisture = low. By applying modus ponens, we can conclude that a possible diagnosis for the condition leaf wilt = high is soil moisture = low.
THE QTIP INFERENCE
ALGORITHM
A full QTIP model of crop growth involves a set of possibly overlapping time stages spanning the period up to the most recent collection of crop data. At each time stage two inference steps are carried out. The first, or abductive step is a comparison of data collected during that time stage with model predictions. This step is used to establish possible deviations of the crop from normal growth patterns. The second, or deductive step forecasts the consequences, both present and future, of deviations from normal identified in the abductive step. The next three sections in this paper describe the abductive/deductive algorithm. This section describes the inference process in a single time stage if there is no uncertainty. The next section describes how time stages are linked together to form a dynamic model, again in the absence of uncertainty. The third section describes the incorporation of uncertainty. The discussion is presented along with an example: the growth of a small grain crop such as wheat, oats, or rice. This example is chosen because it should be fairly familiar or self-explanatory to a broad spectrum of readers. It is important to recognize, however, that the rule base is developed to illustrate the properties of the QTIP inference algorithm, not to be agronomically correct. Indeed, only those portions of the rule base directly relevant to the discussion are shown, and considerable “poetic license” is taken even with those portions that are displayed. A QTIP rule base defining a cause-and-effect model consists of a collection of two types of statements: declarations of each agronomic indicator and its associated ecophysiological state variable, and rules defining individual cause and effect relationships. QTIP employs a simple Lisp-like syntax. The form of statements defining the agronomic indicators of a particular phenological stage and their associated ESVs is (INDICATOR
< AI,, >< ESV,, >)
Expressed in the QTIP syntax, a cause-and-effect rule has the form (RULE < ident > IF
Modeling crop production systems
333
( = = ) ONEOF( = ) ... ( = < value m + n > )THEN (PREDICT < ESV m + n + 1 > < value m + n + 1 > ) .. . (PREDICT )) Here < ident > is the unique rule identifier, < ESV i > represents the name of the ith ESV, and represents a categorical value (i.e., HIGH, MEDIUM, or LOW). Antecedents 1 through m must all be satisfied (they are the “and” antecedents), and any one of the antecedents m + 1 through m + n must be satisfied (these are the “or” antecedents) for the rule to be invoked. The interpretation of the rule is that the if the antecedent ESVs have the indicated values then this causes the consequent ESVs to assume their designated values. PREDICT is an intrinsic QTIP function that binds its second argument to its first. Cause-and-effect rules used in abduction should not contain inequality relationships in either the antecedents or the consequents. This is because inequalities would introduce ambiguity into the assignment of values in the abduction stage. For example, using abduction on the antecedent (Y 2 A) would result in Y being assigned any value that satisfies this relationship. Figure 2 provides a formal description of the QTIP abductive/deductive algorithm. This algorithm will be illustrated through the simple rule base shown in Fig. 3. This rule base represents loosely some of the relationships of the hypothetical small grain crop during the tillering stage, prior to anthesis. No rules are shown other than those actually used in the discussion. Figure 3 shows the example rule base in two ways. Figure 3a shows the actual rules, and Fig. 3b shows a flowchart representation of the rules, indicating the flow of cause and effect. In Fig. 3b the rectangles represent ecological state variables (ESVs), and the parallelograms represent agronomic indicators (AIs). To make the exposition of the process as clear as possible, each step will be described by explaining that step verbally based on Fig. 2 and referring to Fig. 3 to place the step in context. Prior to initiation of the inference process, AI values are computed based on field data. The formulas used in this computation are discussed in the next section. The inference process is initiated by assigning a value LOW, MEDIUM, or HIGH to each ESV associated with an AI, based on stored reference values for that AI (Step 1, Fig. 2). In the example of Fig. 3, these ESVs are groti,th rate, which is associated with average height; sink demand, which is associated with tillers per plant; salinity, which is associated with soil EC (electrical conductivity); interplant competition, which is associated with plant density; and soil moisture, which is associated with irrigation rate. In the example, we will assume that the AIs are such that the ESV values are assigned as follows:
R. E. Plant
334
growth rate = LOW, sink demand = MEDIUM, salinity = MEDIUM interplant competition = MEDIUM soil moisture = HIGH.
After Step 1 is completed, for each ESV with a value of LOW or HIGH, QTIP attempts through abduction to find the cause or causes of this condition (Step 2, Fig. 2). In the present example, the first such ESV is growth rate, with the value LOW. QTIP searches for cause-and-effect rules indicating possible causes for growth rate = LOW (Step 3, Fig. 2). The first rule encountered with growth rate = LOW in the consequent is Rule T2 (Fig. 3).
I. 2.
3. 4.
5.
6.
7.
8
9.
10 11
FOR each AI. BEGIN Bind the categorical value X defined by the AI to the associated ESV. END FOR each ESV having value X determined hy an associated AI. IF X= LOW or X = HIGH BEGIN FOR each Rule R in the rule base, IF Rule R contains in its consequent a statement binding the value X to the ESV. THEN BEGIN FOR each consequent in the rule. IF that consequent binds to its ESV a value directly contradicted by the current memory contents, THEN discard Rule R. FOR each antecedent in the rule. IF that antecedent involves an ESV equality relationship directly contradicted by the current memory contents. THEN discard Rule R. FOR each antecedent in the rule, POST to memory as a hypothetical assignment the relationship defined by that antecedent. WHILE new information is added to the contents of memory. Forward chain deductively. testing each rule in the rule base. IF a rule is invoked and results in an assignment contradicting a value in memory. THEN discard Rule R. REMOVE all contents in memory generated by the preceding hypothetical deductive forward chaining. END IF Rule R has not heen discarded THEN BEGIN Recursively apply the abductive backward chaining algorithm to each ESV in the antecedent set of Rule R. IF the abductive backward chaining step fails to generate any possible cause for an ESV in the antecedent set of Rule m. POST to memory the values in this set. END WHILE new information is added to the contents of memory, BEGIN Forward chain deductively through the rule base. END
Fig. 2. The QTlP
abductive/deductive diagnostic inference algorithm Numbers correspond to steps described in the text.
for a single
stage.
Modeling
crop production
.systems
335
QTIP begins a series of tests to determine whether application of the rule would introduce any inconsistencies when compared with established values. The first step in this process is to check all other consequents in the rule to determine whether any of them directly conflict with established values (Step 4, Fig. 2). In the example, sink &mand = LOW is also a consequent of Rule T2. Since sink demand has already been assigned the value MEDIUM, Rule T2 is discarded. The next relevant rule encountered is Rule T3. This rule expresses the idea that early in the season, when nutrients are not limiting, plants in a high (rulebase tillermg) (mdicator
plant_heighl
(mdicator
tdlersger-plant
(md~ca~or soll_EC
growth_rate) sml_demand)
)
salini@
(indicator
plant_denslt\-
(indcator
ungatlon_rate
soil_molsture)
d (gro\\th_ratc
= LOW)
(Rule TI
In~erplant~competltlOn))
lhen (predict leafgroductlon (Rule T? of (tcmpzrature then (predict
LOW))
= LOW)
gronIh_rate
(Rule T3 d (interplant_competit~on then (prtict (Rule T-t if
growh_rate
grwth_rate
LOW))
tdlergroductlon
(Rule T6 If (tdlergroductlon then (predict
LOW))
= LOW)
a&demand
LOW))
(root_dcvclopmenl= LOW)
then (predict gronlh_rak (Rule TX if (s&m?\
roa_dc\clopment
(Rule TY if (resplratlon then (preckl
(RuleT 12 if
LOW))
= HIGH)
rcspnatlon
if (resplratlon
then
LOW))
= LOW) growth-rate
(Rule T10 If (wil_molsture then (pm&cl
LOW))
= HIGH)
then (pre&ct
(Rule Tl 1
= LOW) LOW))
(&sease_lexel = HIGH)
then (prebct
(Rule T7 if
LOW))
(&sease_l~cl = HIGH)
then (prcdicl (Rule TS If
(predictsink-demand
LOW)
= LOW))
= LOW)
(predictcarboh!draIegroducbonLOW)) (leaf_produc~lon
= LOW)
then (predict photos? nthests LOW)) (end rulebase)
Fig. 3(a). Rule base in QTIP syntax for the simple knowledge base for small grain growth during the tillering stage. This rule base is constructed to illustrate the QTIP inference algorithm and is only loosely based on actual crop growth and development.
336
R. E. Plant
population density environment will tend to grow taller to compete for light, and conversely for a low population density environment. Since there are no other consequents, the first step of the conflict determination process does not eliminate Rule T3 as it did Rule T2. The next step is to test all the variables in the antecedents to determine whether any of these conflict with a value already in memory (Step 5, Fig. 2). QTIP attempts to bind the hypothetical value LOW to interplant competition in memory. However, the value of interplant competition is bound to the value MEDIUM, so QTIP discards RULE T3. The next relevant rule encountered is Rule T4. Invoking the first two steps of the conflict detection algorithm produces no results since no established values are in direct conflict. The third step of the algorithm is therefore carried out. QTIP tentatively binds the hypothetical value HIGH to disease level (Step 6, Fig. 2), and a full forward chaining process is initiated to determine whether any known values are in conflict (Step 7). QTIP tests the consequents of each rule invoked by the hypothetical values. The test succeeds if the
,
T6 salinity = H
disease Iewi = H
density L
Tl
TS tIllor pmductlon = L
t---J
Association
-+
Causal Relationship
L---
leaf prcduction = L
Ecophp~alo~cal State Varlable
Fig. 3b. Flowchart for the rule base of Fig. 3a.
Modeling
crop production
sytems
337
values of the ESVs assigned in memory are such that the consequent set is true, and it fails otherwise. In the present example, Rule T5 is invoked and used to predict the hypothetical value tiller production = LO W. The forward chaining process results in invoking Rule T6 to predict sink demand = LO W. This conflicts with the established value sink demand = MEDIUM. Therefore QTIP, after removing all hypothetical values from memory (Step 8) discards Rule T4. QTIP next encounters Rule T7 and begins testing it for conflicts. Invocation of the conflict detection algorithm of Steps 4-7 detects no violations. Therefore QTIP begins the backward chaining abduction step (Step 9). It attempts to verify root development = LOW, encounters Rule T8, and tests the condition salinity = HIGH. The test fails due to the conflict with the value salinity = MEDIUM. QTIP finds no other relevant rules, and therefore no causal evidence is found for the condition root development = LOW. Since the purpose of the abduction algorithm is to find all possible causes of a particular condition, it does not discard an ESV that has no verifiable precursor. Rather, QTIP binds the value LOW to root development as a possible cause (Step 10). At this point QTIP searches for the next rule with growth rate in the consequent and finds Rule T9. No conflicts are found with established data, and as before QTIP searches for a cause for respiration = LOW. It locates Rule TlO, and, after the test for inconsistency succeeds, the abductive test also succeeds since soil moisture = HIGH has been established in memory. QTIP places respiration = LOW in memory. No other relevant rules are found for growth rate = LOW. A search for ESVs connected to other AIs produces no results. The backward chaining abductive process is complete. The next phase is a forward chaining deduction to identify all consequences of the newly established conditions (Step 11). Forward chaining through Rules Tl, Tl 1, and T12 leads to the conclusions leaf production = LOW, carbohydrate production = LOW, and photosynthesis = LOW. This completes a single step of the abductive/deductive algorithm. These two steps together comprise a single time stage. The abductive step of the algorithm is roughly associated with a backwards time step to search for causes of the present condition, and the deductive step is roughly associated with a forward time step to forecast future consequences. The next section explains the linking of these two-step processes into a sequence of time stages that span the crop season from the beginning until the present. THE INCORPORATION
OF DYNAMICS
The preceding discussion described a single stage of the modeling process. We now turn to the linking of multiple stages in sequence to simulate crop
R. E. Plant
338
growth dynamics. Figure 4 shows the phenology of the hypothetical grain crop. This figure reflects a common feature of crop growth analysis: it is divided into phenological stages separated by biofix points (e.g., Zadoks et al., 1974). The way dynamics is treated in a QTIP analysis reflects this feature. Time is not explicitly distinguished or identified in the model as a separate kind of variable. Rather, time is implicitly included in the model through the identification of one or more sequences of biofix points that separate individual stages. Depending on the crop, these biofix points may be actual representations of elapsed time (e.g. heat units or days since planting), but they may also be based on crop anatomy, for example, the occurrence of panicle initiation. These time intervals represented by stages may overlap, for example in the cases of vegetative and reproductive growth stages in an indeterminate crop. Indeed, any relationships that remain valid for the entire season may be placed in a stage that is always executed. The only restriction is that stages are executed in the order in which they are encountered in the knowledge base. Each separate phenological stage is represented by a different rule base defining cause and effect relationships during that stage. Thus, for example, the model of the hypothetical grain crop considered in this paper contains four rule bases. A major assumption employed in QTIP is that all ESVs are assumed to be fixed in value for the duration of a single stage. This is not necessarily true in the real world: for example, temperature may fluctuate dramatically during the course of a single phenological stage. Thus, the proper interpretation of an ESV as a dynamic variable is that it represents the overall trend of the real variable during the particular stage. For example, if the ESV temperature has the value LOW in the rule base seedling emergence, this is interpreted to mean that the cool temperatures predominated during this period. Repeated observations of field data during a stage are treated as replicated measurements of a single fixed ESV. For example, in the case of temperature, repeated measurements of this as data would be considered as replicated measurements of a single, fixed quantity, interpreted as “prevailing temperature”, rather than as individual measurements of a time-varying quantity. Because of the interpretation of ESVs as constant for the duration of a phenological stage, QTIP must contain an algorithm for determining the Tillering
Seedling Enwgence Planting
Fourth Leaf
Fig. 4. Phenological
I
Grain Ripening
Reproductive Phase Panicle Initiation
I
First Spikelets
Hard Spikelets
I
stages and biofix points of the hypothetical small grain crop used to illustrate the QTIP abduction/deduction algorithm.
Modeling
crop production
systems
339
single ordinal value of an ESV based on multiple ratio or interval values of the associated agronomic indicator. This is a classification problem (e.g., Duda & Hart, 1973) and there are standard solution methods that in principle may be applied. In practice, these methods do not work very well in QTIP, primarily because there are so few data values with which to classify any given ESV in a particular stage. Therefore, a more simple method is used. For each AI, a value A is computed for each field data set (i.e., for each observation). The AI value is then normalized according to the formula A
=
n
A -OS(L+H) H-0.5(L+H)’
where A, is the normalized value of the agronomic indicator, A is the value computed from field data, H is the upper extreme of the MEDIUM range, and L is the lower extreme of the MEDIUM range. When A = H, A, = 1, and when A = L, A,, = -1. Normalization permits the integration of AI values computed at different times during a phenological stage even if the extremes H and/or L vary with time during this period. For example, consider the AI average height in the rule base of Fig. 3. At the start of the tillering stage, the values characterizing the upper and lower extremes of “medium height” will be less than those at the end of this stage, since the plant is growing during this stage. Once the AIs have been normalized, it is a simple matter to categorize the associated ESV. A measure, taken by default to be the algebraic mean, of the normalized values is computed and if this measure is less than - 1, the ESV is assigned the value LOW, if it is greater than 1, the ESV is assigned the value HIGH, and if it is in the range between - 1 and 1, the ESV is assigned the value MEDIUM. Through this process, values can be computed for all ESVs associated with AIs for which data has been collected. The QTIP dynamics algorithm involves the sequential processing of the rule bases defining cause-and-effect relations for each individual stage. Figure 5 shows the structure of a QTIP knowledge base for the grain crop example. The knowledge base consists of the following: a specification defining the function and arguments used to compute each AI from field data; a specification of the quantities that are declared as fixed-valued throughout the execution; a set of rule bases defining cause-and-effect relations; and a MODEL section that defines through control rules the stages and determines the order in which rule bases are activated. Rule bases are processed in the order of appearance in the MODEL section of the knowledge base. For example, in the hypothetical small grain model whose rule base is shown in Fig. 5, the rule bases would be processed in the order seedling emergence, tillering, reproductive phase, ripening. For each rule base in the sequence, the following actions are performed:
340
R. E. Plant
@iicators) (set tillersqerqlant (field-data tillersqerqlant)) (set plant-height (field-data ayg_height)) (set soil-EC (field-data EC)) (set plant_density (field-data density)) (end indicators) (fixed interplant_competition
salinity disease_level)
(model) (if (number_leaves <= 4) then (.execute emergence)) (if (number_leaves > 4) (paniclesqerqlant then (execute tillering))
= 0)
(if (paniclesqerqlant > 0) (spikeletsqerqannicle then (execute reproductiveqhase))
= 0)
(if (paniclesqerglant > 0) (spikeletsqerqannicle then (execute ripening))
> 0)
(end model) (rulebase seedling_emergence) * * * (end rulebase) (rulebase tillering) * * * (end rulebase) (rulebase reproductive phase) *** (end rulebase) (rulebase ripening) * * * (end rulebase)
Fig. 5. Knowledge base of the QTIP qualitative model for the hypothetical small grain crop.
Modeling crop production systems
341
1. For each field data set collected within the interval of the rule base as defined in the MODEL statement, compute the normalized AI values. 2. Compute the reference values of the normalized agronomic indicators. 3. Based on the classification scheme given above, compute the values of all ESVs associated with an agronomic indicator for which data have been collected. 4. Execute the abductive/deductive algorithm to compute all possible ESV values at that stage. QTIP incorporates dynamics through interdependence of ESV values across stages. Any rulebase can directly access the values from previously executed rule bases, which are stored in memory. For example, if the temperature at the time of emergence is measured and its value is established in the seedling emergence rule base, then this temperature can be used in the tillering rule base through a rule such as, Rule T8b if one of (soil moisture = HIGH) or ((rule base seedling emergence temperature) = LOW) then (predict respiration = LOW)).
The second antecedent temperature in the rule traditional LISP syntax representing the function
THE EFFECTS
incorporates a reference to the value of the ESV base seedling emergence. This is expressed in the in which the statement (F x y) is interpreted as F(x,y).
OF UNCERTAINTY
AND VAGUENESS
The discussion of the previous two sections assumes that there is no uncertainty or vagueness in the model. In actual cropping systems this is far from true. There are many sources of uncertainty. In order to discuss these in an orderly way, we will categorize sources of uncertainty as follows: 1. The inability to compute with perfect accuracy the values of agronomic indicators. For example, for a given field there exists in nature an actual value for average height. This value, however, cannot be known with accuracy but only estimated. 2. If the value of the agronomic indicator average height were known exactly, there would still be vagueness about how to associate this value with an ordinal value of growth rate. That is, the boundary between, for example, MEDIUM and HIGH is vaguely, or fuzzily, defined. This sort of vagueness can be interpreted as uncertainty over the classification of numerical values.
342
R. E. Plant
3. If the value of an ESV such as growth rate could be accurately and precisely categorized, application of a cause-and-effect rule would result in uncertainty due to imprecise knowledge and simplified characterization of the actual cause and effect relationship, and to exclusion of some factors from the model. In particular, successive applications of causeand-effect rules reduce the certainty of the inferred values due to confounding with effects not considered in the model. This is true both of abduction and deduction. The formulation of the uncertainty management system in QTIP is based on the interpretation of QTIP as a model. Two interpretations are possible: that it is a model of the actual system (i.e., the crop), or that it is a model of how an expert or group of experts envision the actual system. This distinction is expressed by Shortliffe & Buchanan (1984) as a question: should an expert system attempt in dealing with uncertainty to simulate the actual behavior of a real human expert, or should it attempt to determine how a human expert should behave? There is some evidence, albeit controversial (e.g., Plant & Stone, 1991) that under certain circumstances humans do not process new information and update their beliefs in an efficient way. Nevertheless, the philosophy underlying the formulation of the QTIP uncertainty management system is that it is primarily a model of how an expert would think about the dynamics of the real system, rather than of the real system itself, and that its primary diagnostic function is not to provide information in an oracular manner to the user, but rather to serve as a consultation tool in a peer-to-peer relationship with the user (Coombs & Alty, 1984). One way QTIP deals with the first type of uncertainty given above has already been described. Repeated measurements of field data are interpreted as replications. The data values, normalized according to the predefined classification boundaries for association with the ESV values HIGH, MEDIUM, and LOW, are averaged to determine a single categorical ESV value for that time stage. The methods used to deal with the remaining types of uncertainty can best be understood by considering an example of the effects that each these types of uncertainty has on the QTIP inference and diagnostic process. In the conflict resolution step of the abductive process applied to the rule base in Fig. 3, the condition sink demand = MEDIUM blocks consideration of the conditions disease level = HIGH and temperature = LOW. However, this condition may not be known with certainty, either because of uncertainty in computing its value (type 1 above) or in classifying low sink demand (type 2 above). Moreover, complexities in the causal relationship between temperature and sink demand, or factors outside the model, may mitigate the effect of low temperature in this specific individual crop. The same thing may happen in the case of disease level. In
Modeling crop production systems
343
summary, failure to take uncertainty into account may result in errors of omission in which viable alternatives are not considered. One possibility for dealing with this problem, advocated by Charniak & McDermott (1984), is to incorporate into the abductive algorithm some certainty calculus such as Bayes’ theorem. This approach was not selected for use in QTIP because experience with certainty calculi indicates that, at least in the agricultural domain, the lack of precision with which certainty values can be assigned renders calculations done with these values practically meaningless. For this reason QTIP does not attempt to calculate certainty factors. Instead, it incorporates an uncertainty management system that attempts to mitigate the negative consequences of uncertainty in the simplest way possible. In attempting to diagnose field conditions, the philosophy of the QTIP inference algorithm is that the user should be informed of all reasonable possibilities, and that in diagnosing a condition it is better to incorrectly include a potential cause than to incorrectly exclude one. To this effect, the QTIP abduction/deduction algorithm is modified to strengthen the condition for two values to be in conflict. As described above, two values for an ESV were determined to be in conflict if they were different. For example, in attempting to apply Rule 2, QTTP determined a conflict to exist in the value of sink demand when the value MEDIUM in memory differed from the value LOW in the consequent of Rule 2. If the value of sink demand had been HIGH, this could be taken as clear evidence that Rule 2 should not be invoked. The difficulty comes in comparing hypothetical values LOW or HIGH with the data-determined value MEDIUM. The values of ESVs associated with an AI are computed from the normalized mean A,. Thus an indication of how strongly the value of the ESV fits into its assigned category, or, in fuzzy set terms (Zadeh, 1965) its degree of membership in its assigned set, is provided by this normalized value. Values in the range [- l,l] are classified as MEDIUM, and values outside that range are classified as LOW or HIGH. If tillers per plant has value of 2, = -0.9, this would indicate that sink demand is close to the boundary between the MEDIUM and LOW regions, and has a relatively low degree of membership in the set MEDIUM. The value would, however, still be found to be in conflict with the value LOW contained in consequent Rule 2, causing the abductive application of Rule 2 to fail. To prevent this, the condition for failure due to conflict is strengthened as follows. A datadetermined ESV value (sink demand = MEDIUM in the present example) is determined to be in conflict with a hypothetical value (sink demand = LOW in the present example) if one of the following two conditions is satisfied: (i) The hypothetical value is opposite the data-determined value on the ordinal scale (this would be the case if sink demand had
344
R. E. Plant
the data-determined value HIGH); or (ii) the sign of the associated normalized AI is opposite that of the hypothetical value. In other words, a conflict is identified in the present example if the sign of 2, for tillers per plant is positive, since this indicates a relatively strong conflict between the hypothetical value and the data. The third way QTIP deals with uncertainty is to classify conclusions -based on strength of evidence. In the example rule base of Fig. 3, values such as growth rate = LOW and soil moisture = HIGH have a relatively high leve! of certainty because they come directly from association with data. Values such as photosynthesis = LOW and carbohydrate production = LOW have less certainty because they arise from deductive applications of cause-andeffect rules, which may exclude important factors not considered in the model. The value root development = LOW has even less certainty because there is no data to support it, it is retained simply because low root development is known to cause low growth rate, and factors not included in the model may influence root development. To deal with this, QTIP uses an uncertainty management system most similar to the evidential reasoning method of Cohen (1985). QTIP categorizes ESV values on the basis of the proximity of their relationship to data, using the categories developed in the previous paragraph. Values such as growth rate that are directly associated with data are place in one category. Values such as leaf production and photosynthesis, which are deduced from data, are placed in a second category; no attempt is made to differentiate based on the number of links in the deduction chain. Values such as root development in the example, which are based on abduction, but are not supported by data, are assigned to a third category. The classification does not influence the flow of logic, and therefore no ordinal relationship is assigned to the categories. They are generated as part of the information that can be displayed, if desired, to the user.
DISCUSSION A numerical simulation model may be represented abstractly by the equation x(t) = F(x(t
-
1). t).
x(0) = x,.
Here x is a vector of n state values and F(x,t) represents the structure of the model, which determines the evolution of the state values during the course of the simulation run. In control theory (e.g., Bryson & Ho, 1969), some or
Modeling crop production systems
345
all components of x are considered as not observable, and a vector y of observable variables is added, so that the model becomes x(t) = F(x(t - 1), t),
Y(T)= W(O, t), x( 0) =
x0.
Here G(x,t) specifies how the state variables x affect the observable variables y. By analogy, in the QTIP formalism the ESVs take the place of the vector s of state variables, the AIs take the place of the vector y of observed variables, and the stages take the place of the time steps t. The analogy between the QTIP algorithm and the solution of a numerical simulation model may be pressed further. The algorithm presented in this paper is analogous to the two step process 1. Give y(t), compute x(t) = G-‘(r(t),t) “abduction”; 2. Compute x(t) = F(x(t - I),?) “deduction”. In this context, the conflict resolution algorithm corresponds to a rule that resolves conflicts arising between the computations in Step 1 and Step 2. The analogy is not precise, however, because in QTIP, unlike the numerical model, ESV values may also be deduced from the values of other ESVs at the current time. A second break in the analogy is that in QTIP, unlike the numerical model, ESVs can pass in and out of existence as time progresses. Since ESVs that are not declared as fixed exist only within a given rule base, they need not be defined in other rule bases. In the diagnostic application considered in the present paper, no attempt is made to forecast future values of ESVs. In the terminology of secondgeneration expert systems, the diagnostic application discussed in the present paper is called “postdiction”. Forecasting, or “prediction”, is entirely possible in QTIP, however, and could be accomplished using cause-and-effect rules by incorporating the potential to predict the value of an ESV at a future time. Such a forecasting model would be useful in crop management applications involving the synthesis of management guidelines, as opposed to the analysis of field conditions. The forecasting feature would potentially involve a minor structural change in QTIP in that time in the future would have to be represented explicitly in the model if future time values within a single phenological stage were to be distinguished. The QTIP package has been developed with the intent that it be incorporated as a module into an existing crop management software package such as CALEX/Cotton (Goode11 et al., 1990) CALEX/Rice (Real et al., 1994). or CottonPro (Plant et al., 1994). As such, QTIP contains no provisions for
346
R. E. Plant
direct communication with the user. Rather, this communication is handled by the “parent” package. At the end of a QTIP run, two files are written to disk, one called QTTPVAL.TMP showing the values generated in the run, and the other called TRACE.TMP showing a record of the run itself. The file TRACE.TMP is used in the generation explanations of reasoning. This enhances the explanatory power of the system since it provides the context in which rules were or were not invoked. For instance, if the user in the example described in this paper asks why disease was not listed as a possible cause for the observed low growth rate, the system can provide the answer that the possibility a high disease level was considered but rejected because it would conflict with the observation that tillering was normal.
ACKNOWLEDGEMENTS This research was partially supported by funding from the California Rice Research Board, the Cotton Incorporated California State Support Program, and the USDA National Research Initiative Competitive Grants Program, Grant 9403964.
REFERENCES Anonymous (1990). tntegruted Pest Management .ftir Small Grains. University of California, Division of Agriculture and Natural Resources, Oakland, CA. Blalock, H. M. (1969). Theory Construction. Prentice-Hall, Englewood Cliffs, New Jersey. Bryson, A. E. & Ho, Y. C., (1969). Applied Optimal Control. Blaisdell, Wajtham, MA. Charniak, E. & McDermott, D. (1984). Introduction to Ar@cial Intelligence. AddisonWesley. Reading, MA. Cohen, P. R. (I 985). Heuristic Reusoning about Uncertainty: an ArtiJicial Intelligence Approach. Pitman, Boston. Coombs. M. & Alty, J. (1984). Expert systems: an alternative paradigm. Internationul Journal of’Man-Machine Studies, 20, 21-43. De Kleer, J. & Brown, J. S. (1984). A qualitative physics based on confluences. Artificial Intelligence, 24, 783. Duda, R. 0. & Hart, P. E. (1973). Pattern CIassiJication and Scene Analysis. WileyInterscience, New York. Forbus, K. D. (1984). Qualitative process theory. ArtiJicial Intelligence, 24, 85-168. Gensereth, M. R. & Nilsson, N. J. (1987). Logical Foundations of Artzjicial Intelligence. Morgan-Kaufmann, Los Altos, CA. Goodell, P. B., Plant, R. E., Kerby, T. A., Strand, J. F., Wilson, L. T., Zelinski, L., Young, J. A., Corbett, A., Horrocks, R. D. & Vargas, R. (1990). CALEX/ cotton: an integrated expert system for crop production and management in California cotton. Culifbrniu Agriculture, 44(5), 18-21.
Modeling crop production systems
347
Guay, R., Gauthier, L. & Lacroix, M. (1992). An abductive reasoning expert system shell for plant disorder diagnosis. AZ Applications, 6(4), 15-28. Guerrin, F. (1991). Qualitative reasoning about an ecological process-interpretation in hydroecology . Ecological Modelling, 59, 165-20 1. Ives, P. M., Wilson, L. T., Cull, P. O., Palmer, W. A., Haywood, C., Thomson, N. T., Hearn, A. B. & Wilson, A. G. L. (1984). Field use of SIRATAC: an Australian computer-based pest management system for cotton. Protection Ecology, 6, l-2 1. Iwasaki, Y. & Simon, H. A. (1986). Causality in device behavior. Artificial Intelligence,
29, 3-32.
Just, R. E., Hueth, D. L. & Schmitz, A. (1982). Applied Welfare Economics and Public Policy. Prentice-Hall, Englewood Cliffs, New Jersey. Kuipers, B. (1984). Commonsense reasoning about causality: deriving behavior from structure. ArtiJicial Intelligence, 24, 169-203. Lemmon, H. (1986). Comax: an expert system for cotton crop management. Science, 233,29-33.
Peng, Y. & Reggia, J. A. (1990). Abductive Inference Models,for Diagnostic ProblemSolving. Springer-Verlag, New York. Plant, R. E., Kerby, T. A. & Keeley, M. (1994). Final plant mapping: your tool for improving productivity in next year’s crop. California Cotton Review, 34, 3-5. Plant, R. E. & Loomis, R. S. (1991). Model-based reasoning for agricultural expert systems. AI Applications, 5(2), 17-28. Plant, R. E. & Stone, N. S. (1991). Knowledge-Based Systems in Agriculture. McGraw-Hill, New York. Plant, R. E., Young, J. A., Kerby, T. A. & Goodell, P. B. (1992). Blackboard-based integration of multiple knowledge sources for crop management expert systems. In Proc. IFAC Workshop on E.xpert Systems in Agriculture, International Academia, pp. 24-29. Pople, H. E. (1982). Heuristic methods for imposing structure on ill-structured problems: the structure of medical diagnosis. P. Szolvits et al. (ed.), Arttjicial Intelligence in Medicine. Westview Press, Boulder, CO. Real, J. G., Plant, R. E., Hill, J. E., Young, J. A., Bernheim, L. G., Williams, J. F., Scardaci, S. C. & Wick, C. M. (1994). CALEX/Rice: an integrated expert decision support system for rice production in the temperate zone. In Temperate Rice-Achievements and Potential, Griffith. NSW, Australia: Temperate Rice Conference, pp. 697-702. Saunders, M. C., Haeseler, C. W., Travis, J. W., Miller, R. N., Coulson, R. N., Loh, K. D. & Stone, N. D. (1987). Grapes: an expert system for viticulture in Pennsylvania. AZ Applications, l(2), 13-19. Shortliffe, E. H. & Buchanan, B. G. (1984). Uncertainty and evidential support, Rule-Based Expert Systems. Addison-Wesley, Reading, MA, pp. 209-232. Simon, H. A. & Rescher, N. (1966). Cause and counterfactual, Philosophy of Science, 33, 323-340.
Starfield, A. M. & Bleloch, A. L. (1983). Expert systems: an approach to problems in ecological management that are difficult to quantify. Journal of Environmental Management,
16, 261-268.
Starfield, A. M., Farm, B. P. & Taylor, R. H. (1989). A rule-based ecological model for the management of an estuarine lake. Ecological Modelling, 46, 107-l 19. Stevens, S. S. (1946). On the theory of scales of measurement. Science, 103,677-680.
348
R. E. Plant
Stroudstrup, B. (1986). The C+ + Programming Language. Addison-Wesley, Reading, MA. Weiss, S. M., Kulikowski, C. A. & Amarel, S. (1978). A model-based method for computer-aided medical decision making. ArtiJicial Intelligence, 11, 145-l 72. Winston, P. H. (1984). ArtiJicial intelligence. Addison-Wesley, Reading, MA. Zadeh, L. A. (1965). Fuzzy sets. Information and Control, 8, 338-353. Zadoks, J. C., Chang, T. T. & Konzak, C. F. (1974). A decimal code for the growth stage of cereals. Weed Research, 14, 41542 1.