Articolo presentato al congresso KES 2002
"Knowledge-based Intelligent Information Engineering Systems"
Crema (CR) Italy
16 settembre 2002
A Knowledge-Based Web Site
For Agriculture
Alessandro MAZZETTI
Planasia, Via Brin 124 - 16039, Sestri Levante (GE), Italy
www.planasia.it - planasia@planasia.it
Luca BONINI
Phytoline s.r.l., Str. Prov. Affi-Caprino Km 9, Rivoli Veronese (VR), Italy
Abstract. The portal www.phytogate.com contains several Expert Systems addressed to agronomists. After describing their functionalities, the Expert Systems architecture is inspected. The knowledge tecnology is particularly innovative because it mixes inferential processing with searching algorithms, into a distributed paradigm Applet-Servlet.
1. Introduction
Phytogate.com is a Web Site addressed to agronomists. Phytogate.com has been conceived as a comprehensive Portal, covering as much as possible all agronomists requirements: meteo, regulations, news, laboratory service, live-experts consultancy, fertilizer database…
Phytogate.com does not contain any advertisements and it is not linked to any producer or vendor; it is an independent site, linked to several academic departments and research centres.
Phytogate.com is a pay-site: at present almost 1000 agronomists are registred; a public area exists, containing demonstrators.
The most innovative element of this site is the presence of some Expert Systems designed to support agronomists in their work. At present two Expert Systems are published: "Sepic" for fertilization planning and "Secan" for diagnosis of nutritional deficiency (a third Expert System is planned for disease diagnosis). These Expert Systems constitutes the most valuable part of the site because they are connected to the central Database of Fertilizers, always updated with all commercial products.
2. System Functionalities
Each registered user has his own Reserved Home Page containing data about his ground and crops. The user can benefit from laboratory services and can browse into his Home Page the laboratory tests subdivided into two categories: ground-tests and leaf-tests.
The Expert System is launched by selecting a test item; it analizes test-data and conducts a dialogue with the user. The aim is to advise a fertilization plan.
The dialogue is very interactive, with many questions about the situation and the user preferences. Some questions are graphic, like the one shown in Fig. 1; the purpose of graphic questions is an accurate check of crop disease, by means of visual leaf inspection. At the end of consultation, the Expert System outputs its results, formatted into a table, like the one shown in Fig. 2. A free demonstrative version of the Expert System exists, with limited functionalities; it is available at http://www.phytogate.com/secan/home.asp

Fig.1 The Expert System consultation is performed through questions. Several of them are graphic in order to make diagnosis effective

Fig.2 The results arepresented in a tabular format. Several hypotheses are presented, each of them composed by a list of fertilizers, with their features, quantity, and cost. The list my be reordered in several ways.
3. System Architecture
The web server contains a Database (SqlServer) and a Page Generator (ASP). The Expert Systems are configured as Java-Applets and are totally executed at client side. Comunication between Applet and Database is achieved through URL Stream (HTTP/GET method), supported by specific ASP pages which queries the Database. At initialization, the Applet loads the minimun data necessary to start the consultation (user identification, crop features, ground data); during reasoning more data are gradually loaded (expecially photographs). As soon as the system is ready for searching fertilizers, an appropriate query is done and selected fertilizer data are loaded.
At the end of consultation, results are automatically downloaded on database, using an HTTP/GET method. Results are then presented in an HTML format.

Fig.3 The Expert Systems are Java Applets running on user browser. They communicate with central database through ASP pages.
4. The Knowledge Technology: Plexpert
Each Expert System is structured in three independent modules (separate Java classes):
The Inference Engine is the same for all Expert Systems of the site; it is the commercial product called Plexpert.
Inferential Knowledge is represented by means of Rules with a pseudo-natural syntax. An example of rule is:
IF leaf IS old
AND symptom IS yellowing
AND distribution IS marginal_thin_among_veining (like photograph X)
AND we_are_in_summer
THEN judgement[manganese] IS deficiency
AND_ALSO judgement[sulphur] IS toxicity
Reasoning techniques combines forward and backward chaining, with evocative capabilities (i.e. partially verified rules are considered at low priority) and heuristic search (i.e. data are evaulated only when necessary). Reasoning may be non-monotone (i.e. achieved goals may be re-evaluated when premises changes).
Reasoning is based on predicate logic, with existential and universal quantifiers (i.e. IF_EXISTS, IF_ALL and FOR_EACH). As an example, consider the consequent part of the above rule "judgement[manganese] IS deficiency": the variable "judgement" is declared as a multiple variable (set of chemical elements) and the rule applies only to a specific instance, the one relevant to manganese. In the case in which a rule applies to each instance of a set, the operator FOR_EACH is used:
FOR_EACH laboratory_value GREATER_THAN low_threshold
WHERE laboratory_value LESS_THAN adjusted_standard
THE_CORRESPONDING judgement IS deficiency
One of the most valuable feature of the Inferential Engine is the high integration between inference and procedural processing: the knowledge base mixes Rules and Java-methods with a bidirectional interaction (a rule can call a method; a method can call a rule, launching a backward session). As an example, consider the variable "adjusted_standard" in the above rule: its evaluation is performed by calling a Java method, which in its turn call other rules:
PlexpertMethod[] adjusted_standard { //pure Java code follows
double val = GetThroughBackward(standard);
double correction = GetThroughBackward (correction);
return( val * (1.0 + ( correction / 100.0)));
}
The Knowledge Base is almost equally split between Rules and Java procedural programming: Rules are mainly used for diagnostic modules and for decision trees; on the other hand procedural programming is used for communication with Servlet and for fertilizer selection.
Fertilizer Database is large and complex; each fertilizer is represented in two ways: the "title", and the "product". Fertilizer title is the set of its features from a chemical point of view; an example of title may be: nitrogen 25% phosphorous 8% potassium 12%. For each title several commercial products may exist. The Expert Systems works considering only fertilizer titles, carrying out a selection driven by mathematical formulas and searching algorithms. The main searching technique is "try and test" combined with a ranking respect to several point of view: category, type, composition, suitability for biological agriculture, using comfort,… The set of solutions is built up in two parts: main solutions (displayed in main page, as in fig. 2), containing the best solution for each point of view, and secondary solutions (displayed in another page), containing remaining solutions limited to around twenty.
Particular attention has been given to the problem of solution existence: the Expert System guarantees the emission of at least one solution by means of a "extreme effort" technique. This constitutes a final search taking into account some fertilizers whose type has not been requested by the user, but that guarantees the solution. As an example, if the user chooses organic fertilizer (to comply with agricultural regulations), the "extreme effort" may be accomplished considering mineral fertilizer.
The User Interface is scalable and flexible. When the Expert System is configured as an Applet, a standard AWT graphics is used (Java Abstract Windowing Toolkit). When the system is configured as an "application", a standard Console user interface is used. In future, a Servlet configuration will be available, for mission-critical expert systems in which reasoning should run on the web server.
A demo of reasoning techniques supported by Plexpert is available at: http://www.planasia.it/DemoPlex.html .
5. The key of success
We can consider two kinds of key of success: technological and applicative.
Technological keys of success are:
Applicative keys of success are:
6. Future developments
Phytogate.com is an evolving site; several improvements have been already planned. First of all, an enhanced version of the Expert System is under development, for considering micro-elements into fertilizers.
Secondly, a connection with specific equipments is planned. This will lead to the development of an Expert System whose input data come from user's equipment instead of laboratory tests.
Besides a disease diagnostic Expert System is forecasted; the main difference with respect to the other is the fact that it selects phyto-medicines instead of fertilizers.
Last but not least, the internationalization of all Expert System is planned. This will imply, besides translating messages, also several modifications to knowledge, because local regulations implies different ways of reasoning and different selection criteria.
7. Acknowledgements
The authors wish to thank Nello Bonini, Marino Perelli, Pierluigi Graziano and Duilio Porro for their precious collaboration during the knowledge acquisition for Expert Systems.
References
[1] Alessandro Mazzetti, Costruire un Sistema Esperto, Muzzio Publ. 1986.
[2] Alessandro Mazzetti, Applicazioni dei Sistemi Esperti, Muzzio Publ 1987.
[3] Hayes-Roth, Waterman, Lenat, Building Expert Systems. Addison Wesley Ed. 1983.
[4] J.F.Glimore, Expert System Tool Evaluation. 6th International Workshop on Expert System and their applications, Avignon, 1986.
[5] Marini Perelli, Experience with Fertilizer Recommendations in Italy and in southern Europe, 22nd Colloquium of the International Potash Institute, Soligorsk, USSR june 1990.
[6] Margherita Molfino, Concimi, cosa propone il mercato, Terra e vita, 14/2000.
[7] Duilio Porro, Alessandro Dalpiaz, Gino Stringari, Valutazione dello stato nutrizionale mediante diagnostica fogliare, L'informatore agrario 8/1996.
[8] Duilio Porro, Francesco Iacono, Nutrizione e qualità delle produzioni in viticoltura, L'informatore agrario 28/1999.
[9] Duilio Porro, Gino Stringari, O. Failla, A. Scienza, Thirteen years of leaf analyis applied to Italian viticulture, olive and fruit growing.
[10] Alessandro Mazzetti, Interpretazione Interattiva dei Dati in ambito Internet/Intranet. Workshop AI*IA on Organizational Tools and Intelligent Access for Heterogeneous Information - Padova, Sept 1998.
[11] Alessandro Mazzetti, Strumenti di sviluppo per Sistemi Basati sulla Conoscenza. Giornata di studio ANIPLA su processi produttivi - Milano, Oct 1996.
[12] Alessandro Mazzetti, Sistemi di ausilio all'evoluzione e manutenzione della conoscenza. 5th Symposium of Italian Association for AI (AI*IA). Napoli, Italy, Sept 1996.