# New quality requirements in international exchanges of major cereal grains

Francis Fleurat-Lessard

► To cite this version:

Francis Fleurat-Lessard. New quality requirements in international exchanges of major cereal grains.

7. International Working Conference, Oct 1998, Beijing, China. http://dx.doi.org/10.5285/etho.1279997

HAL Id: hal-02770919

https://hal.inrae.fr/hal-02770919

Submitted on 4 Jun 2020

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
# Diagnosis and grading of wheat grain initial quality by a computerised decision support system

Amadou ndiaye and Francis Fleurat-Lessard<fnref n="1" />

## Abstract

This paper describes the qualitative reasoning used to assess the initial quality of grain. The main problem was the representation of a heterogeneous knowledge in the same homogeneous calculus space, and the development of reasoning methods to handle a formal knowledge base on wheat, malting barley, maize or any other cereal grain. This modifiability implies a user interface with a separation of the static description of the interface (corresponding to the knowledge base) from the interface engine which interprets the static description. A prototype of knowledge based system, QualiS, was built up on Windows platform.

## Introduction

In these last ten years, there have been a great interest on using the knowledge based systems to assist the management of stored grain. Several pest control systems have been developed to support the control of stored grain pests (insects and mites) (Flinn et al., 1990), (Wilkin et al., 1991), (Longstaff et al., 1994), (Pasqual & Mansfield, 1988), (Jones et al., 1993). Today, current research focuses on preservation and grading of grain initial quality (Ndiaye & Fleurat-Lessard, 1994).

Grain quality preservation has traditionally been performed by store-keepers who rely on measurements and observations on grain and its milling products, and on implicit knowledge gained through scientific results, common sense and job experience. Each store-keeper uses his own method to evaluate and grade the initial quality. Grain quality preservation implies both a correct assessment of grain initial quality and of its final use. The main difficulty encountered in rapid grading lies in the accurate evaluation of the grain initial quality (Wrigley et al., 1994), (Maier, 1995). One of the most commonly used method is grading according to grain variety (Morris & Raykowski, 1994). But it can happen that the properties of

a variety of wheat may change from one farming area to another and from one year of harvest to another

We have defined a qualitative model to assess grain wheat initial quality based on the measurements and observations of the grain standard characteristics. In this paper, we present the qualitative representation and reasoning on the heterogeneous knowledge on grain preservation during storage. The knowledge base system QualiS is also described.

## The initial quality of grain

The initial quality of grain is a new and complex concept, there is no model for its quantification. In the literature, models of quality changes during storage relating the maximum safe storage period or loss of dry matter to the temperature and moisture content or carbon dioxide production are proposed. The main characteristics of the grain quality studied were the loss of germinative vigour (Bason et al., 1993; Favier and Woods, 1993), moulds growth (Fraser and Muir, 1981; Armitage, 1986; Latif and Lissik, 1986), and insect pests dynamics which are specific qualities characteristics. The germinative vigour is a technological characteristic, and the mould growth and the insect pests dynamics are sanitary & safety characteristics. Neither all the characteristics of the quality of grain nor their interactions have been modelled: for example the influence of the protein content on the grain quality is not modelled.

The quality of grain is generally defined as the suitability for the end-use of the grain: "the word 'quality' means suitability for the specific process or utilisation for which it's destined" (Wrigley et al., 1994). To establish a sound qualitative or quantitative model of the quality of grain, it is necessary to distinguish the quality to the end-use. Each utilisation implies a given quality of grain. This required quality must be available at the time of utilisation to make it possible. Therefore, to preserve the stored grain quality compared to its possible end-uses, it is imperative to determine before the storage what is the grain initial quality and grade in function with the grain characteristics.

## The baking wheat characteristics

Store-keepers are used to evaluating the grain quality.

<footnote n="1">¹ INRA, Laboratoire des Insectes des Denr's Stock's, BP 81, F 33883 Villenave d'Ornon, France Email: amadou ndiaye @ bordeaux inra fr</footnote>
through measurements and observations on grain and its milling products. Measurements are numeric values from standard tests (temperature, moisture content, protein content, ...) and observations are linguistic values from sensorial tests (colour and smell) or are given by the grain producer (variety, area of production and year of the harvest). We have distinguished seven meaningful variables groups and determined five relevant calculated variables used to represent the four main specific qualities and the global quality of grain:

* Grain identity variables group: the variety of the grain, its area of production and the year of harvest are given as linguistic values by the producer to the store-keeper.

* Grain aspect variables group: the colour and smell of grams are sensorial tests done by the store-keeper, the results of which are linguistic values. These tests could be done automatically by image analysis.

* Environment factors variables group: the relative humidity of the air and temperature of grain, and the carbon dioxide release rate in the grain environment are more or less easily measured by the store-keeper, the results of which are numeric values.

* Intrinsic & physico-chemical characteristics variables group: the moisture content, specific weight and impurity rate of grains, and the weight of 1000 grains are measured by the store-keeper, the results of which are numeric values.

* Sanitary & safety characteristics variables group: the presence of insects (visible living and dead forms, and hidden forms) or mites and the proliferation of micro-organisms in grain, the mycotoxins and the pesticide residues on the grain, and the heavy metals and radioactivity in the grain can be assessed by the store-keeper or a specialised laboratory, the results of which are numeric values.

* Technological characteristics variables group: the protein content, baking quality of wheat and rye flours (baking index W and extensibility index of bread dough P/L), enzymatic activity, quality of the starch, germination vigour and grain hardness can be measured by the store-keeper or a miller, the results of which are numeric values.

* Nutritional characteristics variables group: the quality of lipids, digestibility of proteins, and nutritional value can be measured using specialised instruments by the store-keeper or a feed plant laboratory, the results of which are numeric values.

* Global quality characteristics variables group: the intrinsic & physico-chemical quality, sanitary & safety quality, technological quality and nutritional quality are the specific qualities, and the grain quality can be associated by the store-keeper as qualitative values.

These variables are heterogeneous considering the units of

measurements (seconds, $kh^{-1}/hl$, %, etc.) and the types of values (numerical or linguistic). They were interrelated by cause-effects relations.

## The causal relations between the variables

Two causal relations between variables have been distinguished: influences and gives-information-on (Steyer et al., 1993):

The X influences Y relation has been used to indicate that X is one of the causes of the Y state. The relation between the moisture content and the intrinsic & physico-chemical conditions of baking wheat will give an illustration of the influences relation: baking wheat with a moisture content above 15% will be of an average or bad intrinsic & physico-chemical conditions (because the grain is too humid and has a great risk to be damaged during the storage period). Moisture content is a cause for bad intrinsic & physico-chemical conditions of baking wheat.

The X gives-information-on Y relation has been used to indicate that the state of X gives a qualitative information on the state of Y. For example, a cv. *Soissons* wheat, harvested in the area of Orlans in France, in 1994 belongs to the grade superior baking wheat averaging a protein content of 11.7%, a Zeleny index (quality of the starch) of 35 ml, a Hagberg falling number (enzymatic activity) of 362 seconds, a baking index W of 227 and an extensibility index of bread dough P/L of 0.57. These average measurements are given each year after a 'Cereal Quality' survey made by ONIC and ITCF<fnref n="2" /> in every French area of production and on all varieties with a significant tonnage. The results of this survey are available as early as October for July/August harvest. A prediction of cereal characteristics based on the knowledge on the area of production, the year of the harvest and the variety of the cereal, will cover the period from harvest time to the publication of the results of the survey. This example illustrates a gives-information-on relation linking the grain identity to the technological characteristics.

## The qualitative reasoning to assess the grain initial quality

The qualitative reasoning is based on the theory of Qualitative Physics whose about 20 years old field of Artificial Intelligence (Hayes, 1979) The Qualitative Physics enable us to cope with incompletely known dynamic system using heterogeneous data and the reasoning on these data does not necessary require the use of quantitative

<footnote n="2">² ONIC (Office National Interprofessionnel des Cles) and ITCF (Institut Technique des Cles et Fourrages) are national organisations for grain production and quality</footnote>
relations. The qualitative approach completes the quantitative one by allowing the modelling of human experts qualitative knowledge, but does not intend to replace it in a well-known numerical problem space

<table><caption>**Table 1.** List of the relevant variables in the space of the quality of baking wheat.</caption><thead><tr><th>Meaningful group</th><th>Variable</th><th>Abbreviation</th><th>Value from</th></tr></thead><tbody><tr><td rowspan="3">Grain identity</td><td>variety</td><td>Va</td><td>Observation</td></tr><tr><td>area-of-production</td><td>AP</td><td>Observation</td></tr><tr><td>year-of-the-harvest</td><td>YH</td><td>Observation</td></tr><tr><td rowspan="2">Grain aspect</td><td>colour</td><td>C</td><td>Observation</td></tr><tr><td>smell</td><td>S</td><td>Observation</td></tr><tr><td rowspan="3">Environment factors</td><td>relative-humidity</td><td>RH</td><td>Measurement</td></tr><tr><td>temperature</td><td>θ</td><td>Measurement</td></tr><tr><td>carbon-dioxide-rate</td><td>CO<sub>2</sub></td><td>Measurement</td></tr><tr><td rowspan="4">Intrinsic & physico-chemical characteristics</td><td>moisture-content</td><td>MC</td><td>Measurement</td></tr><tr><td>specific-weight</td><td>SW</td><td>Measurement</td></tr><tr><td>impurity-rate</td><td>ImpR</td><td>Measurement</td></tr><tr><td>weight-of-1000-grains</td><td>W1000</td><td>Measurement</td></tr><tr><td rowspan="8">Sanitary & safety characteristics</td><td>visible-living-form-of-insects</td><td>LF</td><td>Measurement</td></tr><tr><td>visible-dead-form-of-insects</td><td>DF</td><td>Measurement</td></tr><tr><td>hidden-form-of-insects</td><td>HF</td><td>Measurement</td></tr><tr><td>presence-of-insects</td><td>PIns</td><td>Calculation</td></tr><tr><td>ergosterol-content</td><td>EC</td><td>Measurement</td></tr><tr><td>proliferation-of-micro-organisms</td><td>PmO</td><td>Calculation</td></tr><tr><td>mycotoxins-pesticide-residues</td><td>MT</td><td>Measurement</td></tr><tr><td>presence-of-mites</td><td>PR</td><td>Measurement</td></tr><tr><td rowspan="5">Technological characteristics</td><td>heavy-metals</td><td>PMit</td><td>Measurement</td></tr><tr><td>radioactivity</td><td>HM</td><td>Measurement</td></tr><tr><td>baking-index</td><td>Rad</td><td>Measurement</td></tr><tr><td>extensibility-index-of-bread-dough</td><td>W</td><td>Measurement</td></tr><tr><td>baking-quality</td><td>P/L</td><td>Measurement</td></tr><tr><td rowspan="6">Nutritional characteristics</td><td>protein-content</td><td>BQ</td><td>Calculation</td></tr><tr><td>enzymatic-activity</td><td>PC</td><td>Measurement</td></tr><tr><td>germination-vigour</td><td>EA</td><td>Measurement</td></tr><tr><td>quality-of-the-starch</td><td>GV</td><td>Measurement</td></tr><tr><td>grain-hardness</td><td>QS</td><td>Measurement</td></tr><tr><td>nutritional-value</td><td>GH</td><td>Measurement</td></tr><tr><td rowspan="4">Global quality characteristics</td><td>digestibility-of-proteins</td><td>DP</td><td>Measurement</td></tr><tr><td>quality-of-lipids</td><td>QL</td><td>Measurement</td></tr><tr><td>intrinsic-and-physico-chemical-quality</td><td>Qipc</td><td>Calculation</td></tr><tr><td>sanitary-and-safety-quality</td><td>Qss</td><td>Calculation</td></tr><tr><td rowspan="3">Global quality characteristics</td><td>technological-quality</td><td>Qt</td><td>Calculation</td></tr><tr><td>nutritional-quality</td><td>Qn</td><td>Calculation</td></tr><tr><td>grain-quality</td><td>Q</td><td>Calculation</td></tr></tbody></table>

The problems we intended to solve were:

1. to integrate in the same calculus space all the characteristics of grain, the pertinent variables. This problem includes the choice of an appropriate vocabulary to describe the grain conditions.

2. to integrate in the same computer system grain characteristics (measurements and observations on grain and its milling products), and knowledge from
scientific results, common sense and job experience.

3. to build up a modifiable knowledge base system to be used in different environments: a silo where the nutritional characteristics are not taken into account, and a silo where they are; or a silo where they have an instrument to measure the wheat baking quality and another where they have not etc...

Qualitative modelling

A static causal graph has been developed as the structural model of the causal relationships between the variables. It was an oriented graph where the nodes were the variables – the measurements, the observations and the calculations –, and the oriented links (arcs) were their relationships (Figure 1).

The qualitative representatives of measurements and observations, and the calculations were defined in the same discrete qualities space. Work done on qualitative reasoning, and particularly the Dual formalism developed by Guerrín (1995), seemed particularly efficient to represent the qualities space. Applying this formalism, it became possible:

* to define the qualitative representatives of measurements and observations, and the calculations into the same

qualities space

* to determine the computing operators on this qualities space

* to define a vocabulary to describe the grain conditions.

The qualities space

Each variable was defined into a specified validity domain. Here, for every variable of any type, its validity domain could be divided into a maximum of seven intervals of values, representing the relevant qualitative differences. For example the moisture content (mc) is defined between 8 and 22%: if $mc \le 12\%$ the grain is very very dry, if $12 < mc \le 13\%$ the grain is very dry, if $13 < mc \le 14\%$ the grain is dry, if $14 < mc \le 15\%$ the grain is normal, if $15 < mc \le 16\%$ the grain is humid and if $16\% < mc$ the grain is very humid and could not be preserved in this condition.

The qualities space QS composed by seven symbolic elements {$vvl, vl, l, m, h, vh, vvh$} were used to represent the significant intervals of values of each variable (Table 2). The elements were ordered – $vvl < vl < l < m < h < vh < vvh$ – and elementary operators were defined (Guerrín, 1995). The qualities space allows us to manipulate in the same space variables with very different interpretations and semantics; this property is very important for our purpose.

<figure><img src="image_2.png" /></figure>
<figure><img src="image_3.png" /><figcaption>**Fig. 1.** Causal graphs of variables: (0) represents the causal relations of the meaningful groups, and the (1) to (8) represent the causal relations of the variables of each meaningful group</figcaption></figure>

<table><caption>**Table 2.** The qualities space QS.</caption><thead><tr><th>Qualities</th><th colspan="4">Examples of interpretation</th></tr></thead><tbody><tr><td>Vvh</td><td>very very high</td><td>excellent</td><td>very cold</td><td>very very dry</td></tr><tr><td>Vh</td><td>very high</td><td>very good</td><td>cold</td><td>very dry</td></tr><tr><td>H</td><td>high</td><td>good</td><td>fresh</td><td>dry</td></tr><tr><td>M</td><td>medium</td><td>average</td><td>normal</td><td>normal</td></tr><tr><td>L</td><td>low</td><td>mediocre</td><td>half-warm</td><td>humid</td></tr><tr><td>VI</td><td>very low</td><td>bad</td><td>warm</td><td>very humid</td></tr><tr><td>Vvl</td><td>very very low</td><td>very bad</td><td>very warm</td><td>too humid</td></tr></tbody></table>

The computing operators

The operators which allow combination of human-experts knowledge in the qualities spaces were defined. These operators were built up as ad hoc decision tables. They enabled us to put into words the projection laws for measurements and observations into the quality spaces, and the combination laws within these spaces. These laws were associated with weighing factors ranging from zero to one (Tables 3 and 4).

<table><caption>**Table 3.** Example of projection tables q-sw and q-mc of respectively the specific weight measurement (sw) and moisture content measurement (mc) into the qualities space QS</caption><thead><tr><th colspan="3">Specific weight<br>(kg/Hl)</th><th colspan="2">Moisture content<br>(%)</th></tr><tr><th>q-sw</th><th>Qualitative<br>value</th><th>Weighing<br>factor</th><th>q-mc</th><th>Qualitative<br>value</th><th>Weighing<br>factor</th></tr></thead><tbody><tr><td>sw ≥ 80</td><td>H</td><td>0.9</td><td>mc ≤ 12</td><td>vvh</td><td>0.95</td></tr><tr><td>80 > sw ≥ 75</td><td>M</td><td>0.9</td><td>12 < mc ≤ 13</td><td>vh</td><td>0.95</td></tr><tr><td>75 > sw</td><td>L</td><td>0.9</td><td>13 < mc ≤ 14</td><td>h</td><td>0.95</td></tr><tr><td></td><td></td><td></td><td>14 < mc ≤ 15</td><td>m</td><td>0.95</td></tr><tr><td></td><td></td><td></td><td>15 < mc ≤ 16</td><td>l</td><td>0.95</td></tr><tr><td></td><td></td><td></td><td>16 < mc</td><td>vl</td><td>0.95</td></tr></tbody></table>
<table><caption>**Table 4.** Example of combination table (sw-mc) of specific weight (SW) and moisture content (MC) of baking wheat into the qualities space QS; and its associated weighing factors.</caption><thead><tr><th rowspan="2"></th><th colspan="6">MC</th></tr><tr><th>sw-mc</th><th>vl</th><th>L</th><th>m</th><th>h</th><th>vh</th><th>vvh</th></tr></thead><tbody><tr><th rowspan="3">SW</th><th>l</th><td>vvl</td><td>L</td><td>l</td><td>vl</td><td>vl</td><td>vl</td></tr><tr><th>m</th><td>vvl</td><td>M</td><td>m</td><td>m</td><td>l</td><td>l</td></tr><tr><th>h</th><td>vvl</td><td>H</td><td>vh</td><td>h</td><td>m</td><td>l</td></tr></tbody></table><table><thead><tr><th rowspan="2"></th><th colspan="6">MC</th></tr><tr><th>vl</th><th>l</th><th>m</th><th>h</th><th>vh</th><th>vvh</th></tr></thead><tbody><tr><th rowspan="3">SW</th><th>l</th><td>1</td><td>1</td><td>0.8</td><td>0.9</td><td>1</td><td>1</td></tr><tr><th>m</th><td>1</td><td>1</td><td>1</td><td>0.8</td><td>1</td><td>0.9</td></tr><tr><th>h</th><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></tbody></table>

### The vocabulary to describe the grain conditions

To describe the grain conditions we used a simple vocabulary, close to the one of store-keepers. It allows us to manipulate concepts such as ‘this grain is heated’, ‘this grain is not sound’ or ‘this grain is too humid’ etc.... (see Table 5).

<figure><img src="image_4.png" /><figcaption>**Table 5.** Example of vocabulary to describe the grain conditions.</figcaption></figure>

In spite of its simple graphical representation, the causal graph is a powerful tool for modelling a complex and modifiable system. The stored grain ecosystem is a complex system where several variables interact and influence the grain quality. In this domain, it happens that new instruments are developed in order to measure new characteristics improving decision making for grain quality diagnosis. In this case it would be very easy to add a new node in the causal graph; and if one test is not longer used, it will be easy to retract a node from the graph.

### Qualitative reasoning

We established the abstract operations to describe functionally the causal relations between the variables, a method to propagate the weighing factors from the human experts in the causal graph determined, and a nonmonotonic reasoning to handle the modification of the value of measurements and observations.

#### The abstract operations

The determination of abstract operations was based on the distinctive features of meaningful groups and the nodes and links of the causal graph.

Meaningful groups: we distinguish the meaningful groups which only give information on other meaningful groups (Grain aspect and Grain identity), the meaningful groups which influence the future of the grain quality (Environment factors), and the meaningful groups concerning the grain conditions or characteristics (Intrinsic & physico-chemical conditions, Sanitary & safety characteristics, Technological characteristics, Nutritional characteristics and Global quality characteristics):

* The variables included in the groups Grain aspect and Grain identity were only used to supply the lack of measurements of variables on which they give information. For example, if we could not measure the ergosterol content to induce the qualitative proliferation of micro-organisms, the colour and smell of grain should be used to deduce less precisely the qualitative proliferation of micro-organisms.

* The variables included in the group Environment factors were used to predict the risk of grain damaged by the micro-organism proliferation, insect pests dynamics, germination, etc.

* The variables included in the groups Intrinsic & physico-chemical conditions, Sanitary & safety characteristics, Technological characteristics, Nutritional characteristics and Global quality characteristics were used to calculate initial quality of grain.

Nodes and links: we distinguish the nodes without predecessor (leave nodes) to the nodes with predecessor. The types of nodes are: measurement (mes-X), observation (obs-X), and calculation X. There are two types of links: influences and gives-information-on. The criteria of our reasoning on a node were the number and the types of its predecessors and the types of links.

From these criteria and the distinctive features we defined six abstract operations to calculate the qualitative value of each node: Projection, Induction, Deduction, Reduction, Prediction and Critic. They took one argument (Projection and Induction), two arguments (Reduction), or either one or two arguments (Deduction, Prediction and Critic). An abstract operation was a relation between one or two nodes (the inputs), a node to be calculated (the output), and an operator to be executed in order to get the value of the node to be calculated.

* a Projection was a one argument operation which declares
a projection of a measurement or observation in the qualities space; its input was a leave node, and its output was a calculation.

* an Induction was a one argument operation which declared an induction of a calculation node from another calculation node. The relation between the proliferation of micro-organisms (PmO) and the ergosterol content (EC) in the Sanitary & safety characteristics meaningful group (figure 1 (5)) illustrate an Induction: EC which is influenced by PmO is measured to have information on PmO

* a Reduction was a two argument operation which declared a reduction of two calculation nodes into another calculation node. For example, the baking quality (BQ) is a reduction the baking index (W) and the extensibility index of bread dough (P/L).

* a Prediction was a two argument operation which declared a prediction of a calculation node from two other nodes. The risk of proliferation of micro-organisms (PmO) is predicted from the temperature of grain (q) and the relative humidity of air (rh).

* a Deduction was a one or two argument operation which declared a deduction of a calculation node from one or two other calculation nodes. The hidden form of insects (HF) could be deduced from the visible living form of insects (LF) and the visible dead form of insects (DF)

* a Critic was a one or two argument operation which declared an improbability of the value of one calculation node at a given moment or an inconsistency between two

calculation nodes. For example, if the ergosterol content (EC) is high and the moisture content (MC) normal, the grain might have been dried before.

The operations were used to represent in the knowledge base the causal relations between the variables (Figure 2) and to indicate how to use the computing operators. The operations were meta-rules which indicated how to generate new knowledge from raw data and results: they were used to represent in the knowledge base the causal relations between the variables and to indicate when to use the computing operators (Figures 2 and 3).

### Propagation of uncertainty

In this situation of an expert domain, events were not necessarily repeatable, and the exact mathematical form for the uncertainty and the relative frequency of errors were unknown. The human expert had given weight factors to his decision rules in associating them with a subjective probability which came from his own expertise. The weighing factors associated within the computing operators were propagated through the calculus space to determine the certainty factor of each calculation node (Ndiaye et al., 1997) using the following formula:

$$CF = C \times WF$$

with CF the certainty factor to compute, WF the weighing factor of the operator to be executed, C the confidence level linked to the likelihood of an event, symbolised by the presence of one or several objects in the system status space:

<figure><img src="image_5.png" /><figcaption>Fig. 2. A simplified initial quality assessment process for baking wheat</figcaption></figure>
<table><caption>Fig. 3. Projection of the measured temperature and Reduction of moisture content and specific weight</caption><tr><td>(projection</td><td>* type of operation *</td></tr><tr><td>measure temperature</td><td>* input *</td></tr><tr><td>quality temperature</td><td>* output *</td></tr><tr><td>q-t)</td><td>* the operator to be used *</td></tr><tr><td>(reduction</td><td>* type of operation *</td></tr><tr><td>quality moisture-content</td><td>* input1 *</td></tr><tr><td>quality specific-weight</td><td>* input2 *</td></tr><tr><td>quality moisture-content-specific-weight</td><td>* output *</td></tr><tr><td>sw-mc)</td><td>* the operator to be used *</td></tr></table>

$$C = \begin{cases} 1 & \text{if } N=0 \\ f(CF_1, \dots, CF_n) & \text{else } \{N>0\} \end{cases}$$

$C_f$ the certainty factor associated to the $i^{th}$ node used as an argument of the operation to be applied, $N$ the total number of arguments of the operation to be applied associated to a certainty factor, $f$ was a function that combined the $CF_i$, and defined in function of the pair <operation, type of the node to compute>.

### A nonmonotonic reasoning

A nonmonotonic reasoning was necessary to allow the user to simulate the decrease or increase of the measurement values (temperature, moisture content, ergosterol content, etc.). Every modification of the value of a measurement modifies the value of every node directly or indirectly influenced; and consequently modifies the assessment of the quality of grain (Ndiaye 1998).

## QualiS: a prototype of a modifiable knowledge base system

QualiS is an on-going expert system project for the preservation of grain initial quality during the storage period QualiS was structured in three main parts: a modifiable user interface, a knowledge base and an inference engine. This structure allows us to build up a modifiable knowledge base system to be used in different silo environments. The graphical user interface allowed the user to ignore totally the reasoning engine language, and to exchange intuitively with it (Pon, 1997). The knowledge base contained the facts and rules representing the human experts knowledge: the variables of the grain quality domain (nodes of the causal graph), qualities spaces, operators, weighing factors and defined vocabulary are facts; the operations, the models to propagate the weighing factors are rules. The inference engine integrated the formal procedures and functions to compute the knowledge.

### The modifiable graphical user interface

The graphical user interface has been implemented in

Allegro Common Lisp (Steele 1990) For easy learning and using by a non computer specialist, this interface used Windows standard controls, as buttons, lists, etc. (Figure 4). These controls were organised following the classical style of Windows applications. This interface could be completely controlled with the mouse, and many ergonomic details made it easier to use: as spin-boxes to help entering numbers, help tootips indicating the meaning of every graphical object, etc.

As the system may be changed, to follow the progress in measuring tools and techniques, or to work with another type of cereal grain, the graphical user interface had to be built up in order to facilitate the software setting up. The description for the windows and data was loaded at run time. This description was divided in two parts: the static part (the description in a specific language of the windows and their contained objects) and the dynamic part (the dynamic relations between the objects).

The static part: described all the objects involved: the displayable graphical objects (the windows, buttons as OK button for example, the spin-boxes to assist the measurements entry, spin-check-boxes<fnref n="3" /> for the data entry of non necessarily available measurements as the ergosterol content, etc) and the static relations between graphical objects (contain and to-align) Every graphical object was well defined as an object representative of a data entry or an only displayable object. The description of each graphical object was completed by the corresponding raw data type (measurement, observation or null if it was an only displayable object) and by a help tooltip (Ndiaye et al., 1998).

<footnote n="3">³A spin-check-box is a spin-box associated to a check-box: if the check-box is checked it means 'I have got the value' then the spin-box is made enable, otherwise spin-box is made disable; and then the push-button, associated to the window for the data entry of observations which gives information to supply the lacking value, is made enable</footnote>
<figure><img src="image_6.png" /><figcaption>Fig. 4. The main window of the graphical user interface</figcaption></figure>

This part was written in a language to be used by non computer specialists. It was very simple, yet complete. The following example presents a language close to French (figure 5). In fact, this language was translated at run-time into English, and internally treated in English. This on-the-fly translation was achieved by the use of a dictionary file which provides, for each keyword, a conversion between English and the user language.

Each action onto the graphical interface was associated to a fact, specified in the description. At run time, these facts were transmitted to the inference engine, which became informed of what the user did.

The dynamic part: described the dynamic relations between the graphical objects. This description allowed actions to start when some conditions became true. The knowledge base contained a declaration of all the existing dynamic relations between the user interface objects. These relations were represented as couples (conditions, action); so when the conditions of a dynamic relation became true, an order was given to the user interface to execute the corresponding action. For example when the number of visible living or dead form insects was more than zero, the push-button (Rartition des insectes) associated to the identification of insects window was made enable; or when the cancel button of a window was pushed, all the facts coming from the objects contained in this window were retracted, the facts derived from them to and the window hidden.

## The knowledge base

The knowledge base has been implemented in CLIPS (Giarrantano and Riley, 1994). It was a set of declarative knowledge on preservation of stored grain quality, actually the baking wheat, and the knowledge on the dynamic part of the user interface (Ndiaye et al., 1998).

## The inference engine

The inference engine has been implemented in CLIPS. It computed every knowledge base which was built up using the specific representation described in (Ndiaye et al., 1997), and monitored the display of the main windows of the user interface (Ndiaye et al., 1998).

# Discussion

## Evaluating the system

QualiS qualitative reasoning approach represents a significant advance in existing computer knowledge based systems for preservation of stored grain. The departure from pest control to quality preservation is a big change for the stored grain conservation This is clearly an advance for the grain storage industry, which previously could deal with the total quality of grain only in very specific cases. QualiS allows store-keepers to assess the initial quality and grade of grain at delivery. It further provides the grain conditions, the complementary tests to be done to refine the grain
quality, the incompatible uses of the grain, the grain quality preserve the grain quality (Figure 6).
alteration risks and the storage operations to be done to

1) ((identificateur temperature)
 objet-graphique (entree-nombre
 (type-de-donnee nombre-entier)
 (libelle 'Temperature')
 (valeur-par-defaut 20)
 (pas 1)
 (valeur-min -20)
 (valeur-max 50)))
 (saisie donnee mesure)
 (aide 'Entrez ici la temperature du grain.'))
2) ((identificateur fenetre-principale)
 (objet-graphique (fenetre
 (Titre 'Entre des donn's principales')
 (action a-afficher)
 (contient etat-physico-chimique qualite-technologique etat-sanitaire
groupe-des-boutons-fenetre-principale)
 (a-aligner etat-physico-chimique qualite-technologique)
 (a-aligner)
 (a-aligner etat-sanitaire groupe-des-boutons-fenetre-principale)
 (a-aligner)))
 (saisie ordre nul))

**Fig.5.** Static part: 1) description of spin-box temperature; 2) description of the main window which contains group-boxes (etat-physico-chimique qualite-technologique etat-sanitaire) and a group of push buttons (groupe-des-boutons-fenetre-principale). Every group-box contains the description of graphical objects, and the group of push buttons contains the description of push buttons.

One of the main problems was to determine the grain
quality and grading from measurements and observations on
grain and its milling products. The qualitative reasoning on
knowledge used, allowed an homogeneous calculus space to
combine our heterogeneous data. Another problem was to
define a generic enough system to be used for different types
of cereal grains, it was satisfied. The high level definition of
the inference engine, the separation between the
knowledge-base and the inference engine, and the
modifiability of the user interface allows the use of QualiS
for different types of cereal grain by just changing the
knowledge base and the initialisation parameters (the static
part) of the user interface.

On going work

In this version of QualiS we are developing a results
display module of the user interface allowing the user to
easily ask questions on the results. When the results are
displayed in natural language as 'The grain quality is
considered as very good with a suggestive evidence of
0.95', where the keywords are underlined, the user would

be able to ask questions on these keywords. For example
What is? for the keyword grain quality, or Why? for very
good. This will be done with a simple mouse click on the
keyword; and then a floating menu will be displayed,
allowing the user to choose, in the list of available
questions, the question he asks.

In the future version of QualiS, we will develop a planning
and a monitoring modules as parts of the reasoning engine;
also we will develop an interface for the maintenance of the
knowledge base by the human experts. The goal of the
planning module is to generate an optimal technical route for
the storage of grain; and the monitoring module will predict
and control the grain quality evolution in time. If it is a
significant gap between the prediction and the grain
condition, the storage technical route will be re-planned
after a diagnosis of the causes of the gap.

Acknowledgements

Part of this project has been financially supported by the
Conseil Rional d'Aquitaine.
<figure><img src="image_7.png" /><figcaption>**Fig. 6.** The results are presented through four parts: the grain quality, the grain conditions and its linked advice, the grade of the grain and the remarks (degradation risks and inconsistencies)</figcaption></figure>

## References

Armitage D. M. 1986 Pest control by cooling and ambient air drying. in Flannigan B. Spoilage and mycotoxius of cereals and other stored products. C. A. B. International.

Bason M. L., Ronalds J. A. and Wrigley C. W. 1993 Prediction of safe storage life for sound and weather-damaged malting barley¹,². Cereal Foods World, Vol. 38, No 5, pp. 361–363.

Favier J. F. and Woods J. L. 1994 The quantification of dormancy loss in barley (Hordeum vulgare L.). Seed Science and Technology, No 21, pp. 653–673

Flinn P. W., Hagstrum D. W. 1990 Stored Grain Advisor : a knowledge-based system for management of insect pests of stored grain. AI Applications, No 4, pp 44–52.

Fraser B. M., Muir W. E. 1981 Airflow requirements for drying grain with ambient and solar-heated air in Canada. Transactions American Society of Agricultural Engineers, No 24, pp. 208–210

Giarratano J., Riley G. 1994 Expert Systems, Principles and Programming. 2d edition, PWS Publishing Company, Boston, MA.

Guerrín F. 1995 Dualistic algebra for qualitative analysis. 9th International Workshop on Qualitative Reasoning, Amsterdam, pp. 64–73, 16–19 May 1995

Hayes P. 1985 The naive physics manifesto, in Hobbs J. and Moore R. Formal theory of the common sense world, Ableix, Norwood, pp. 1–36.

Jones T. H., Mumford J. D., Compton J. A. F., Norton G. A., Tyler P. S. 1993 Development of an expert system for pest control in tropical grain stores. Postharvest Biology and Technology, No 3, pp. 335–347.

Latif N. and Lissik E. 1986 Respiration model for heat and moisture release during grain storage. American Society of Agricultural Engineers, Paper No 86–6508.

Longstaff B. C., Cornish P. PestMan 1994 A decision support system for pest management in the Australian central grain-handling system. AI Applications, No 8, pp. 13–23.

Maier D. E. 1995 Grain Quality Task Force, Quality Grain Needs TLC. Grain Quality Newsletter, No 16, pp. 3–6.

Morris C. F., Raykowski J. A. 1994 A computer-aided approach to the evaluation of wheat grain and flour quality. Computers and Electronics in Agriculture, No 11, pp. 229–237.

Ndiaye A., Fleurat-Lessard F. 1994 Research on an expert system for appropriate management of the quality of stored grain for food and feed processing. Proceedings 94 International Symposium & Exhibition. on New Approaches in the Production of Foodstuffs and Intermediate Products from Cereal Grains and Oil Seeds, Beijing. pp. 537–540,
16 – 19 November 1994.

Ndiaye A, Pon L., Fleurat-Lessard F. 1997 Diagnosis and Grading of Grain Initial Quality. Proceedings 3rd International Workshop on Mathematical and Control Applications in Agriculture and Horticulture, Hannover. pp. 219–224, September 1997.

Ndiaye A., Pon L., Fleurat-Lessard F. QualS, 1998 Preservation of stored grain quality, diagnosis and grading of wheat grain initial quality. Proceedings Bio-Decision 98, International Conference on Engineering of Decision Support Systems in Bio-Industries, 12 pages, Monpellier, France, February 23–27, 1998.

Pasqual G. M., Mansfield J. 1988 Development of a Prototype Expert System for Identification and Control of Insect Pests. Computers and Electronics in Agriculture, No 2, pp. 263–276.

Pon L. 1997 Relisation de l'interface graphique modifiable d'un system expert de diagnostic et de prervation de la qualité du grain. Rapport de DESS de Gie Logiciel,

Université Bordeaux I, Septembre 1997

Steele Guy L., Jr 1990 Common Lisp the Language, 2d edition. Digital Press, 1990.

Steyer J. P., Queinnec I., Pourcel J. B., Goma G. 1993 On the interest of a qualitative approach in biotechnological process modelling and control. Proceedings Artificial Intelligence for Agriculture and Food, Nes, Oct. 93, 221 – 230.

Wilkinson D. R., Mumford J. D., Norton G. 1991 The role of expert systems in current and future grain protection. Proceedings 5th Int. Working Conference on Stored Product Protection, Bordeaux, Sept. 90, Vol. 3, pp. 2039–3046.

Wrigley C. W., Gras P; W., Bason M. L. 1994 Maintenance of grain quality during storage - prediction of the conditions and period of 'safe' storage. Proceedings 6th Int. Working Conference on. Stored Product Protection, Canberra, April 94, Vol. 2, pp. 666–670, 1994.