You are on page 1of 6


M. T. Maliappis 1 , C. P. Yialouris 2 , S. G. Deligeorgis 1 and A. B. Sideridis 2

1 Animal Breeding & Husbandry 2 Informatics Laboratory Agricultural University of Athens Iera Odos 75, 11855 Athens, Greece

Abstract: In this paper we present the architecture of an integrated management and decision support system which contains expert components dedicated to carry out specific tasks of the daily management in a pig breeding farm. Although these components form a mosaic of various task performing tools, their tight coupling and interaction enables the system to pre-estimate and evaluate the overall farm performance. The system actually tries to optimize the management of the farm, exploiting the numerous information items kept in its databases and interrelating these data with the user's selection of choices provided.

Keywords: Decision Support Systems, Knowledge Bases, Expert Systems, Knowledge Representation, Agriculture.



Since the management of a modern swine breeding herd is becoming a complex and very important task for the economic viability of a farm, new efficient information technology tools are needed integrated on a decision support system (DSS) for carrying out successively complicated day to day farm operations. Existing systems can support the pig farm owner or advisor during the

detection of production disorders and in the analysis of the characteristics of the production disorders. However, a further diagnosis of possible causes of the production disorders is not given by the programs developed so far. Our major goal is to build an Expert Management Information System for Pigs (EMISP) capable to carry out specific tasks of the daily management in a pig breeding farm. This can be achieved through the integration Expert Systems, together with the decision support models, into an Integrated Management Information System (IMIS) (Sideridis, 1988). The potential is particularly great for animal management and production, where traditional decision-aid software and the equivalent of an expert’s knowledge is needed for typical day-to-day problem solving and decision making. The main emphasis of the system is directed towards the productive and reproductive characteristics of the pigs. There is a strong relationship between the zootechnical parameters and the economic yields of a farm, (English et al, 1977). If the observed parameters are kept into acceptable limits the system remains stable and the economic targets are more easily achievable. Integration of expert system tools with traditional systems analysis, optimization and simulation modeling, is a relatively new and unexplored area of agricultural science. Our objectives are:

1. To build a database with all the data needed for the daily management of a reproductive pig farm.

2. To develop knowledge bases extracting data from the DB for identification and classification of pig farm problems.

3. To construct DSS, that can assist farmers in the collection, simplification, analysis and interpretation of data in consisted methodical manner.

First European Conference for Information Technology in Agriculture, Copenhagen, 15 18 June, 1997

Database Data Blackboard Knowledge

Relational DBMS

Relational DBMS
Relational DBMS Expert System Shell

Expert System Shell

Database Data Blackboard Knowledge Relational DBMS Expert System Shell
Database Data Blackboard Knowledge Relational DBMS Expert System Shell
∑ Data entry ∑ ∑ Bases Data Entry and Management Periodic schedules Reports’ construction Inference

Data entry

∑ Data entry ∑ ∑


∑ Data entry ∑ ∑ Bases Data Entry and Management Periodic schedules Reports’ construction Inference

Data Entry and Management

Periodic schedules

Reports’ construction

and Management Periodic schedules Reports’ construction Inference Engine Control Blackboard   Decision
and Management Periodic schedules Reports’ construction Inference Engine Control Blackboard   Decision
Inference Engine Control Blackboard

Inference Engine Control Blackboard


Decision Support Models

Sows’ indexing

Pigs’ indexing

Decision Support Models ∑ Sows’ indexing ∑ Pigs’ indexing

Expert Systems

Sows’ culling

Pigs’ selection

Expert Systems ∑ ∑ ∑ ∑ Sows’ culling Pigs’ selection Farm evaluation Performance estimation

Farm evaluation

Performance estimation

Expert Systems ∑ ∑ ∑ ∑ Sows’ culling Pigs’ selection Farm evaluation Performance estimation
Expert Systems ∑ ∑ ∑ ∑ Sows’ culling Pigs’ selection Farm evaluation Performance estimation
Expert Systems ∑ ∑ ∑ ∑ Sows’ culling Pigs’ selection Farm evaluation Performance estimation

Figure 1. System Architecture

4. To integrate the expert system tools into the IMIS in tight coupling with the decision support components of the system.

2. System Architecture

The following components constitute the main parts of the EMISP:

Graphical User Interface (GUI)

Databases and knowledge representation

Expert system shell

Data entry and daily management module

Expert systems

Decision support and simulation models

As shown in Figure 1, the system components are tightly connected into an integrated system, transparently interacting with each other as needed, without any user intervention. The user selects the desired action and the system is responsible to carry it out asking the user for any data required and are not found in the system database.

2.1 Graphical user interface

The user interacts with the system through a specially designed unified interface which assimilates the peculiarities of the various components. A graphical user interface (GUI) provides a user friendly and comfortable environment in which he/she works and communicates with EMISP. The GUI presents interactive forms and command menus to retrieve and update system parameters and steering variables, to enter user constraints and preferences and to prevent relevant DSS information back to the user after simulations have run and knowledge based inferences occurred. The GUI provides only appropriate sets of choices and warns user about potential erroneous implications of its actions. The user always feel in control of the software, rather than feeling controlled by the software.


Databases and knowledge representation

The whole system is developed around a relational DBMS. The system's database contains data for daily management concerning individual animals, sows, piglets and boars. Data about the animals are recorded beginning from the birth of the animals until the withdrawal of them from the farm. Aggregated data are calculated in regular intervals and are stored into the database. These data are presented to the user through specially designed reports to give him an overall view of the farm’s position and activities. They are, also, used by the expert system components and decision support models to implement their tasks. Knowledge bases used by the ES are stored in tabular form under the management capabilities of the RDBMS. The storage of the KB in tabular form is selected for portability purposes by a work presented in Lorentzos, et al (1995) and Yialouris et al (1997). This approach facilitates the construction and the manipulation of the knowledge bases, as well as the interchange of data between the knowledge bases and the database of the system. The use of a single RDBMS makes the system more efficient. Problems of synchronization or inconsistency are eliminated and data redundancy is kept to the minimum. Also the data flow between the various components is improved.

2.3 Expert system shell

In building the knowledge bases of the system, we need an Expert System shell with the special capability of getting its knowledge base from database tables. Other requirements from the ES shell concern the cooperation with the RDBMS and the interchange of data between them. Since this is hard to achieved by the available commercial shells, because of their closed architecture, we used the AUA-ES shell, a dedicated ES shell specially designed in Informatics laboratory of the Agricultural University of Athens, for this particular purpose. Its initial design principles are presented in Yialouris (1993).\ A full description of the last implementation, including recent enhancements, can be found in Maliappis & Yialouris (1996). The AUA-ES shell is rule based. A condition or a conclusion can be an O-A-V triplet or simply an assertion. Each condition of a rule is connected with the previous and the consequent ones by a conjunction or a disjunction. The keywords (rule, if, then, and, or) are defined by the user. This facility enables a user to write his/her own KB in his/her own language. Like any other ES development tool, the AUA-ES can support forward and backward chaining mechanisms using certainty factors. However, to reduce the search time in the KB, the system uses a mixed mechanism. That is, it begins by feeding the system with initial information using forward chaining and continues by backward chaining. The mechanism selects the first rule of the KB which has not been rejected. In examining a condition of a rule, the system uses backward chaining to collect the appropriate information. After that, using a forward mechanism it fires or rejects rules apart for the one under examination. If the system reaches a conclusion, then it displays a short report concerning the action which is related to that conclusion. The AUA-ES has been extended for the purposes of this project with a blackboard control component. Blackboard component is used to co-ordinate expert systems that co-operates to solve a common problem or for the integration of ESs with conventional problem solving techniques. The blackboard architecture is based on a special case of the opportunistic reasoning model. The opportunistic reasoning model solves problems by applying pieces of knowledge in the most appropriate manner (forward, backward, etc.) and at the most opportune time. Problems that require a variety of input data and a need to integrate diverse information, require many independent or semi- independent pieces of knowledge to co-operate. Quite often also require multiple knowledge representation and reasoning techniques well suited for a blackboard type solution (Engelmore et al,


2.4 Data entry and management module

Data entry and validation are carried out through a process which is incorporated into the daily management needs of the farm. The data needed by decision support modules to curry out decisions

and by ESs for consultation are collected as a by product of the ordinary management process. This approach increases availability of data and simplifies the overall process. This same module is responsible for the construction of daily, weekly and monthly schedules and reports, as well as the periodically calculation of statistics and aggregated data. An important component of the system that is incorporated into the data entry module is the data integrity and validation component. Because of the distinctive environment of the pig farm, where the system will be installed, we made special efforts to reduce the possibility to incorporate into the system erroneous data. Specially designed interactive forms present to the user any available information contained into the system database and inquire only the necessary data, making the necessary checking and validations at the form

2.5 Decision support and simulation models

Decision support modules examine possible solutions and suggest their relative importance and preference. In our system two such decision support models are developed. Both, are used as a preliminary step in a synergetic process with ES components. The first in selection of sows subject to culling and the second in selection of the young pigs. These models run and produce a first relative grade for the specified animals. Their results are stored into the database and are used as input to the respective expert system to give the final results. Sows Indexing model: Sows’ culling depends mainly on reproductive characteristics of sows. Because of low heritability of these characteristics the use of genetic values alone is unsafe. Simultaneous consideration of several biological and economic variables and relationships is critical to the accuracy of sow evaluations for replacement purposes, (English et al, 1977). Culling decisions are usually based on economic considerations. Sows are not replaced because they are no longer able to produce in a biological sense, but because replacement gilts are expected to yield a higher return. Our model ranks the sows subject to culling, considering biological and economic variables, using a dynamic programming model as suggested by Dijkhuizen et al., 1986 and Huirne et al., 1995. Pigs Indexing model: A similar to the above model is the one that assists to the selection of the replacement animals, gilts or boars. Our model gives the relative selection index for the young pigs under selection using the ultrasonic measurements of fat thickness and M. long. dorsi depth, as described in Rogdakis et al. (1994).

2.6 Expert Systems

The expert components of the system use a vast amount of information concerning detailed data for the individual sows, boars and piglets as well as statistical data, distribution, classification and frequency data coming from specialized statistical components. All these data either form the knowledge of the systems' continuously evolving KB or formulate the particular problem which may disrupt farms normal function. It is then the system that proceed on a dialog with the farm manager aiming at providing the optimum solution concerning the particular problem. Various ES can be used as decision aids in pig management. Four are under development for the needs of our system, according their usefulness and their potential use. The first which evaluates the farm performance and the second which estimates farm performance inference about the farm considering it as a whole entity. The other two, the Sows culling and the Pigs selection ESs, inference about individual animals. The same knowledge base is used successively for each animal, using different fact values and the results of each consultation are written into the database. These two ESs are, also, coupled with the corresponding decision support models interpreting and refining their output results. A brief description of each of the four ESs is given below:

Evaluation of farm performance: This ES inferences about the whole farm performance. It is actually a set of individual ESs cooperating, transparently, through a blackboard. Getting the number of the weaned piglets per sow per year, as an index of the farm performance (Tomes & Nielsen, 1982), the system attempts to identify problems to the farm function. If any problem exists the system continues to specify the sectors of the potential problems and to suggest possible solutions.

During the inference session the expert component uses the detail data for the individual sows, boars and piglets as well as statistical data, distributions, classifications and frequencies coming from specialised statistical components and are stored into the system database. Pre-estimation of farm performance: This is an ES which pre-estimates farm performance depending on several external parameters, the values of which can be specified by the user. For different combinations of the parameters the user has the opportunity to define a scenario which can be evaluated by the ES. The current data of the farm and their trends are considered to estimate farm performance. As external parameters may considered the length of the milking period, the sows replacement rate and the age of sows at the first parity. Sows culling expert system: Sows are culled not only because of insufficient productive and reproductive performance, but also because of more qualitative reasons, such as lameness and leg weakness, mothering characteristics, and utter quality. Because of the qualitative nature of these characteristics they are a preferred source to an expert system. According to Huirne et al, (1995), a combination of an optimization model with an ES gives the best results in choosing of sows subject to culling. This ES interprets the results of the sows indexing model, taking into account several morphological characteristics of the sows, such as the functional number of teats, the soundness of their legs, the breeding difficulties and the characteristics of their parents. Pigs selection expert system: The aim of this expert system is to assist the selection process of the candidate pigs to insert into the reproduction chain. This component works synergistically with the indexing program which ranks the animals according their productive characteristics under selection. Apart from the calculated index, some other characteristics of the animals, such as the soundness of their legs, the number and the position of their teats or the litters they come from, are to be considered, English, et al (1977). The expert system takes the results of the indexing model combines them with the qualitative data and gives the final grades for the animals.

3. Implementation

EMISP is being developed on Microsoft Windows operating system platform. MS Windows operating system is chosen because of its standalone characteristic and its wide availability. We selected MS Visual C++ as our development tool for its power and object oriented characteristics. An object oriented approach on computer software development led to improved maintainability and understandability of the software (Booch, 1986). Exploiting the object oriented features of Visual C++ and conforming to the principles of object oriented programming, the reusable code is maximised and the development time is reduced. For the RDBMS support of the system we used the capabilities of Microsoft Jet Database Engine. The connection to the Jet Engine is achieved through Direct Access Objects (DAO) using the Microsoft Foundation Classes (MFC). This approach has the advantage that many off-line management tasks can be carried out by using Microsoft Access DBMS. Using the MFC classes in the development of our system we are able to incorporate easily into it many of the features offered by the MS-Windows graphical user interface. The skeleton of our system was easily completed leaving us the time to concentrate on our actual problems.

4. Conclusion

EMISP, aims to make farm management easier, more efficient and more profitable for farmers to operate, using state of the art modeling and information technology tools. The system combines the

facilities found in ordinary record keeping and management systems with the advanced capabilities offered by the decision support and expert components, into an integrated decision support system. Its functions can be utilized trough the friendly GUI without unnecessary overlapping or repetition of operations and data. Till now the data entry and management module, which constitutes the backbone of the system, are completed. In parallel, with the Pig Indexing model and the Farm Evaluation ES are also

Knowledge acquisition is an issue and a time consuming process and it acts as a


restriction to our efforts in development of the other expert components. We try to exploit the experience collected in the Animal Breeding and Husbandry division of the Agricultural University of Athens in pig farming, using two experts in the field for ESs construction and evaluation. The system, will be installed in a number of reproductive farms throughout Greece. Thus, the evaluation process will be undertaken in real farm environments and possible modifications and improvements will be also performed during this stage. EMISP can be easily extended incorporating new decision support models and expert components. We aim to extend our system, in the future, incorporating new expert components and substituting the Pig Indexing model by an implementation of the BLUP procedure (Henderson, 1984). The expert component with the highest priority to be included in the future is the one that aids at the design of the mating policy of the farm. An other future component is the one which computes and guides the annual genetic improvement obtained by the genetic selection plan adopted by the farm manager.



Booch, G. (1986). Object-oriented development. IEEE Transactions on Software Engineering. 2:211-


Dijkhuizen, A.A., R.S. Morris & M. Morrow (1986). Economic optimization of culling strategies in swine breeding herds, using the ‘PorkCHOP computer program’. Preventive Veterinary Medicine, 4:341-353. Engelmore, R.S., Morgan, A.J. & H.P. Nii (1988). Introduction. In: (R.S. Engelmore & A.J. Morgan (Ed.)) Blackboard Systems. 1-22. Addison-Wesley Publishing Company. English, P., W. Smith & A. MacLean (1977). The sow - improving her efficiency. Farming Press Limited, Suffolk, Great Britain. Henderson, C.R. (1984). Applications of Linear Models in animal Breeding. University of Guelph, Canada. Huirne, R.B.M., A.A. Dijkhuizen, J.A. Renkema & P. Van Beek (1995). Integrated decision support and expert systems: Application in farm management. In: (A.J. Udink de Cate, R. Martin- Clouaire, A.A. Dijkhuizen & C. Lokhorst (Ed.)) 2 nd IFAC/IFIP/EurAgEng Workshop on Artificial Intelligence in Agriculture. 309-314. Elsevier Science Ltd. Wageningen, The Netherlands. Lorentzos, N.A., C.P. Yialouris & A.B. Sideridis (1995). Valid Time Rule-Based Knowledge Bases. Proceedings of the 5th Conference in Informatics, Athens, pp. 1005-1014. Maliappis, M.T. & C.P. Yialouris (1996). AUA Expert System Shell version 2: Design and Implementation. Technical Report, Informatics Laboratory, Agricultural University of Athens. Rogdakis, E., J. Bizelis, A. Kominakis, D. Papavasiliou, M. Maliappis & F. Georgantopoulou (1994). Ultrasonic fat and muscle depth measurements in pig: Repeatability and implementation in the selection process. Animal Science Review, 19: 5-19. Tomes, G.J. & H.E. Nielsen (1982). Factors affecting reproductive efficiency of the breeding herd. In:

(D.J.A. Cole & G.R. Foxcroft (Ed.)) Control of pig reproduction. 527-539. Butterworths Scientific. Yialouris, C.P., (1993). Expert Systems: On the Structure of Expert System Shells- Applications in Agriculture. Ph.D. dissertation (In Greek with English abstract). Agricultural University of Athens, Science Department, Athens. Yialouris, C.P., H.C. Passam, A.B. Sideridis & C. Metin, (1997). VEGES: A multilingual expert system for diagnosis of pests, diseases and nutritional disorders of six greenhouse vegetables. To appear in Computer and Electronics in Agriculture. Sideridis, A.B. (1988). Informatics and municipalities. Information and Management 14:183-188.