Abstract
The coffee rust is a devastating disease that causes large economic losses across the world. The severity of this disease changes over time so the farmers are not fully aware of the economic importance of the rust disease in the coffee crops. From a computational science perspective, several investigations have been proposed to decrease the effects caused by the coffee rust appearance from Expert systems based on machine learning techniques. However, because samples about coffee rust incidence are few, the rules created from machine learning techniques do not contain enough information to consider the diversity of scenarios for detecting coffee rust. This paper proposes an expert system based on rules, where the rules are created considering the expert knowledge of specialists and technical reports about the behavior of the disease during a crop year. As far as we know, this is the first expert system proposed using not only expert knowledge but also technical reports in the coffee rust problem. The Buchanan methodology is used to design the proposed system. Experiment results present an average accuracy of 66,67% to detect a correct warning of coffee rust levels.
Introduction
Coffee rust is a devastating disease that causes large economic losses across the world. The causal agent is the fungus Hemileia vastatrix. The severity of this disease changes over time, so the farmers are not fully aware of the economic importance of the rust disease in the coffee crops. Especially, when the weather is appropriate and the fruit load is high, the coffee rust causes big losses [1]. In the period between 2008 and 2012, the weather conditions favored the coffee rust growth causing that an appropriate control of the crops to prevent the appearance of the disease was not possible, affecting the production in several countries, including Colombia (its production descended 31%), El Salvador (its production descended 54%) and many places from Central America [2]. As a consequence, several research works have been conducted to detect the factors that promote the growth of this disease [3]. The authors in [4] present a literature review for detecting and forecasting pests and diseases in several crops. Authors conclude that coffee is one of the most studied crops, in countries like Colombia, due to its economic importance.
Several modeling approaches applied to coffee rust have been tested to detect the disease in the time. Some algorithms of “black box” as Support Vector Regression (SVR) [5], neuronal networks (NN) [5, 6], Bayesian networks [7], Error Correction Output and SVM [6–8] have been used to detect the disease due to this type of modeling approaches have a high accurate; the different research works have demonstrated that these algorithms have an small alert error probability for detecting coffee rust. Algorithms with graphic representation also have been used to detect coffee rust, since these approaches allow to know the characterizes of the models built and analyze it to take important decisions [5–7, 10]. On the other hand, Corrales (2015) concludes the ensemble methods approach can improve the performance of coffee rust detection, given that it has been demonstrated that the combination of several classifiers can improve the results in a classification/regression process [5]. In the coffee context, researchers have used ensemble methods using neural networks, SVR and regression trees [11] and random forest [6].
Although the studies mentioned above address the coffee rust detection, the experiment results use a low number of instances to predict the coffee rust incidence (0% – 100%). When there are few samples, the data are not able to represent the study population, and then the classifiers are not accurate [5, 11]. In the coffee rust context, the number of samples always will be small, since the collection method of coffee rust infection is done monthly and on some days of the month [13]. To increase the volume of data (amount of coffee rust samples), which a limiting factor as indicated by Corrales 2015, two studies propose the use of machine learning techniques. Authors in [12] propose the cubic spline interpolation to increase the measurements of Incidence of Rust (IR). Authors in [14] propose a guideline for generating coffee rust samples by applying machine learning techniques.
Although these research works propose methods to increase the volume of coffee rust data, the researchers only consider the algorithm behaviors. However, to detect appropriately the coffee rust, it is necessary to aggregate information from the main factors that cause this disease.
Due the lack of coffee rust samples, an interesting alternative is to leverage the knowledge of the coffee farmers and agronomists to tackle the coffee rust disease. This paper proposes a rule-based expert system able to trigger a warning about the level of rust in the coffee crops, considering not only the weather conditions but also the production behavior in Colombian coffee zones. The paper is organized as follows: Section 2 describes the main concepts involve in the study and the related works with expert systems in several agricultural domains. Section 3 develops the expert system for detection of coffee rust warning. In Section 4 the results obtained in the evaluation of expert system with specialists in coffee crops are discussed. Finally, Section 5 shows conclusions and future works.
Materials and methods
This section introduces the definition about coffee rust and expert systems and present related works.
Background
Coffee rust
The coffee rust disease is caused by the fungus Hemileia vastatrix. Among the cultivated species, Coffea arabica is the most severely attacked. The disease begins with the appearance of yellowish spots underside the leaves. When the disease is acute, the coffee rust causes defoliation, the death of branches and heavy crop losses [15]. The expression and intensity of the disease are the result of interactions between [16] the crop characteristics, the pathogen, the environment, and crop management, that all can vary particularly weather.
Colombian researchers describe the progress of the disease through polynomial curves, each curve being different depending on the region of production [13]. In general, the progress of the coffee rust depends on four factors [17]:
–
–
–
–
Expert system
The expert systems (ES) collect information from specialists into a specific area and generate solutions to a problem doing use of the knowledge collected. The systems based on rules are an appropriate tool to solve problems. The knowledge base contains the variables and the set of rules that define the problem; on the other hand, the inference engine obtains the conclusions applying the logic of the rules [18]. A rule is a logical proposition that explains the relationship between two or more variables and includes two parts: the premise and the conclusion. A rule is written usually like this: “if premise, then conclusion” [19]. An example of a rule shows as follows:
As example, considering the following expressions: Zone = 1 → p. Trimester = 4 → q. Amplitude of temperature = small → r. Month = wet → s. Humidity = greater 80% → t.
Then, the formula of a rule into an expert system could be as follows:
The expression above represents a rule into an expert system, when a user enters that: The main coffee harvest in the region is in the first semester of the year (zone = 1). During the fourth semester of the year data have been collected. The amplitude of temperature is less than 12°C (small). The month of the data collected is wet. And the relative humidity is greater than 80%.
So, the expert system concludes that the level of coffee rust with those conditions is “medium”.
Several studies have used ES to detect or to diagnose pests and diseases in the agricultural context. A systematic mapping was made to find research works related with the agriculture expert systems. Two exclusion criterions were used to select the investigations found: “recent papers (less than 10 years)” and “literature reviews” The systematic mapping based its search on the following research question:
“¿What kinds of agriculture expert systems are used to detect pests and diseases?”
In the systematic mapping 14 papers were found. However, only 9 papers were selected. Five excluded papers were focused on literature reviews. The papers selected were found in the following sources of information: IEEEXplore (4), ScienceDirect (2) and SpringerLink (3). We defined the next search query: “(“expert system” OR “expert systems”) AND (“disease” OR “diseases”) AND (“agriculture” OR “coffee”)”. These results showed two types of expert systems: 1) systems focused on the diagnosis of pests and diseases, and 2) systems focused on the detection of pests and diseases. The papers found in the systematic mapping are described below:
Expert systems to diagnose and detect pests and diseases
The expert systems found propose different ways to create decision rules. Some authors use machine learning techniques to generate rules according to the behavior of their data [9, 21], these research works use graph pattern, criteria decision, weighting techniques and regression and classification algorithms to extract rules and define guidelines. Other authors use image databases to save examples of different diseases and using computer vision approach and a set of rules they are able to build an efficient expert system [22, 23]. Finally, some research works consider the opinion of people with high knowledge in a specific topic to create the rules. A rule-based expert system for rice and wheat crop pest diagnosis and management is developed in [24]. The system presents a user graphical interface to show comparisons between the user and the system responses. In [25] an expert system based on a web application is presented; the objective of this system is to diagnose pests and diseases in rice plants. The knowledge in the system is created by using production rules and forward chaining to analyze the symptoms from attacked rice plant.
In Malaysia, a set of rules are created to develop an expert system for the diagnosis of oyster fungal disease. This ES assists farmers in the crop management decisions [26]. For controlling and diagnosing diseases in crops like legumes, an expert system called PulsExpert has been developed [27]. This system uses rules defined from the knowledge obtained by several experts on the topic. In China, researchers designed an Internet-Based Expert System to detect pests and diseases. This system is based on organizing the knowledge related to the agricultural pest species/category and their characteristics. The idea is to build a dynamic expert system where several experts of the diseases and pests in the agriculture update information about diseases and pests to improve the knowledge rules [28]. The studies focused in the diagnosis and detection of pests and diseases are summarized in the Table 1.
Expert systems focused in to diagnose and detect pests and diseases
Expert systems focused in to diagnose and detect pests and diseases
Several research works used expert systems based on rules to detect or diagnose pests and diseases. The rules in this kind of expert systems are created based on several types of information, such as datasets with disease samples, expert knowledge from specialists and technical reports, and from machine learning techniques used to build rules based on context information. This paper proposes an expert system to prevent the coffee rust appearance considering some key factors that explain the behavior of the disease during a crop year. Expert systems to diagnose crop pests and diseases are not good options to this purpose because the main objective of this kind of systems is identifying (not always with good results) pests and diseases in crops through rules based on information of the databases, that contain samples (images mainly) of different diseases and pests in the crops studied. Expert systems proposed to detect pests and diseases using rules created from machine learning techniques and validated by expert knowledge are more appropriate to our purpose as their objective is to prevent the appearance of the disease. However, because samples about coffee rust incidence are few [4], the rules created from machine learning techniques do not contain enough information to consider the diversity of scenarios for detecting coffee rust. For this reason, this paper proposes an expert system based on rules, where the rules are created considering the expert knowledge of specialists and technical reports about the behavior of the disease during a crop year. As far as we know, this is the first expert system proposed using not only expert knowledge but also technical reports in the coffee rustproblem.
This section presents the design of the expert system proposed. The Buchanan methodology [29] was used to build the ES for detection of coffee rust warning. This methodology is based on a hierarchical life cycle, which defines five modules or steps: identification, conceptualization, formalization, implementation, and validation or test. These steps are described as follows:
Identification
This step identifies the actors to build the system and their roles in the construction. In this stage, the resources and knowledge sources available are also identified. The study has identified the next aspects:
To understand the problem context, the following knowledge sources are used: Technical reports from Centro Nacional de Investigaciones del Café (Cenicafé) Several datasets from the central zone of Colombia with samples of the percentage of rust incidence Knowledge from specialists in coffee crops and biological sciences
Once the resources available are identified, several interviews with experts in coffee diseases and experts in computational systems are carried out. Considering the previous factors, the most important tasks of the expert system are: The system allows that the users enter the weather variables for which they want to predict the level of coffee rust in their crops The system returns an early warning about the rust level in their crops
Conceptualization
The main task in this stage is to describe the expert knowledge obtained for the project. The weathervariables and the rust progress curves for the different coffee zones from Colombia are described.
In this case, we can obtain two different types of information: qualitative and quantitative:
Qualitative information

Progress curves of coffee rust without control.
Quantitative information
In this step, the knowledge base of the ES is created: first, setting the rules and then, defining the engine knowledge.
Description of variables
Zones identifies for the expert system
Zones identifies for the expert system
Basic variables that the user enter in the expert system
Processed variables that belong the rules of the expert system
In the other hand, analyzing the weather variables independently, it can be said that: The amplitude of temperature (ΔT) less than 12°C the temperature is never too high or too low for rust (particularly colonization which is temperature dependent). A short amplitude with means very low or very high is not favorable. In general, the dry and very wet months do not favor the development of the disease. In a dry month there is no germination, so no infection; and a very wet month usually the rainy wash the leaves, so the spores of the fungus are reduced. The average monthly of the humidity greater than 80% favor the development of the disease.
However, these considerations can be change taking into account the joint analysis of the weather variables. For example, a value of ΔT small (<12°C) and a month very wet do not favor the development of the disease because constant rains clean the leaves of the crops, but a value of ΔT large can maintain high constant temperatures and eliminate the excess of water in the leaves, providing a level of humidity appropriate to development of the disease into a month very wet.
Considering the all above, it is created a rule of the expert system in the following order: To identify the zone (crop area) To identify into the zone which trimester the data come from To analyze the weather conditions and concluding a coffee rust level
Taking account the next expressions:
Then, the formulas of a rule into the expert system are:
The expert system contains 96 rules divided as follows in the Table 5.
Categories of the rules in the expert system
This step converts the knowledge into formal software documentation which defines the software tools used in the expert system, the user interface, and the system architecture.

Expert system architecture.
Use case “get rust level”
Considering the interviews with the experts, the interface of the system has two options for entering data; one of them is a manual entry, where the user has specific values to analyze the basic variables. The second option provides the possibility of entering a dataset, in this second option the ES analyzes the last 28 days and calculates the averages of the numeric basic variables, then, the processed variablesare built.
The expert system rules were evaluated with experts in the coffee context. The experts that interacted with the expert system are a PhD in Biology (subject 1) and the operational manager in Supracafé Colombia (subject 2). The protocol of the test is described as follow:
The premise
The experts made the test based on the following premise:
“Each value added by the expert in the system is the average value of the 28 days before”
The input variables
Each expert must analyze the following input variables:
The answer provided by the expert
The system response
The experts add the different values of the input variables and run the expert system. The expert system returns an answer of low level, medium level or high level according to the application of its rules.
Discussion
Each expert compares his answers with the answers proposed by the expert system, and then they make an analysis to get feedback about the system. The results are described in the next section.
Results
Once the expert system was built in a desktopapplication, the experts used the system to evaluate the system responses. The subjects used the system taking into account the protocol described in Section 3.5. The measures used to evaluate the system responses are:
Where:
The system responses compared with the prediction of each expert allowed generating a confusion matrix for each expert. Expert system easily identified the true negatives responses with subject 1 (Fig. 3). In other words, the system identified better the responses that do not belong to any of the coffee rust levels. This mainly happens because it is difficult for the system to find a difference between a high and medium level of coffee rust.
Figure 4 shows the results for subject 2. In this case, high and medium levels of coffee rust have the same behavior. For this reason, the false positives and false negatives measures are almost equal to true positives and true negatives values. On the other hand, this expert did not find any case with a low level of coffee rust. The Table 7 shows a summary of the expert system results with each expert.

Expert system results (%) of the levels of coffee rust warning with the subject 1.

Expert system results (%) of the levels of coffee rust warning with the subject 1.
Summary of expert system results
According to our results, the system has a good accuracy; the system predicts a correct value of the coffee rust levels 66,7% of the times. However, the precision is affected by the ability of the system to distinguish between a high level and a medium level of coffee rust obtaining an average value of 50%.
This research presents an expert system for detecting a warning of coffee rust levels in crops. The use of methodologies to build the expert system allowed designing a system that considers weather properties and expert knowledge about the progress of the disease in different places of Colombia to create 96 rules and trigger preventive warnings about coffee rust levels. The expert system has an accuracy to trigger a correct warning of 66,7%. The system needs to be expanded and their rules updated to consider new scenes and improve its accuracy. It is needed to consider:
The Colombian researchers use machine learning algorithms to build models able to detect the coffee rust incidence rate or the growth rate of the disease into some experimental farms. These models have been created using datasets with information about weather variables of the crop zone and some samples of coffee rust; some works have information about crop properties, these studies are limited by the lack of data on coffee rust. This paper proposed an expert system that can trigger a warning about the coffee rust level in the crops taking account information about weather variables and crop zone properties. The proposed rules can work even when data are not available. However, it is necessary to increase the analysis to build new rules to improve the system results considering the specific zones of coffee crops and dates of the coffee crops, besides the temperature interpretation must be analyzed deeply.
As future works we propose first, to update the rules taking account information about the flowering period dates and the month where the harvest is most high, second, to use time series for weather variables to deduce coffee rust behavior at short term (few days), to work with ontologies in order to represent the coffee rust knowledge and this way to do semantics inferences, and finally build an expert system considering the case based reasoning.
Footnotes
Acknowledgments
We thank to the Telematics Engineering Group (GIT) of the University of Cauca for the technical support, the Tropical Agricultural Research and Higher Education Center (CATIE). Besides, we are grateful with the experts Apolinar Figueroa
1
and Wilton Benitez
" href="#fn2" id="a-84">
2
to assess the Expert System. Finally, this work has been partially supported by Colciencias through PhD scholarship granted to MsC. David Camilo Corrales and Cauca Innovacción Nucleus Group for the Young investigator program to Ing. Edwar Javier Girón. This work has also been supported by:
Project: “Alternativas Innovadoras de Agricultura Inteligente para sistemas productivos agrícolas del departamento del Cauca soportado en entornos de IoT - ID 4633” financed by Convocatoria 04C–2018 “Banco de Proyectos Conjuntos UEES-Sostenibilidad” of Project “Red de formación de talento humano para la innovación social y productiva en el Departamento del Cauca InnovAcción Cauca”. Spanish Ministry of Economy, Industry and Competitiveness (Projects TRA2015-63708-R and TRA2016-78886-C3-1-R).
