SOUTHERN JOURNAL OF AGRICULTURAL ECONOMICS DECEMBER, 1989 XLAYER: AN EXPERT SYSTEM PROVIDING MANAGEMENT ADVICE TO COMMERCIAL LAYER MANAGERS Ed Schmisseur and John Pankratz Abstract Expert or knowledge-based system pro- XLAYER, an expert/knowledge-based mi- grams contain domain-specific knowledge and crocomputer program, was designed and de- use complex inferential reasoning to reach veloped to diagnose layer management prob- conclusions human experts would reach if faced lems and recommend expert remedial man- with a comparable problem (Hart; Weissand agement advice. The program also provokes Kulikowski). The basic knowledge contained management action by calculating the eco- in these programs consists of rules, facts, re- nomic loss attributed to major management lationships, reasons, and heuristics obtained problems. It analyzes data generated by a from human experts who can solve problems commercially marketed layer performance fi- in a particular domain of expertise. Expert nancial microcomputer program and has dem- systems embody techniques for solving prob- onstrated the ability to emulate poultry man- lems, manipulating stored knowledge, coping agement experts in the diagnoses of 80 indi- with uncertain information, and explaining how vidual layer management problems. The pro- an inference is proceeding or a conclusion has gram provides scarce expert poultry manage- been reached (Simons). ment advice to poultry layer managers regard- Expert or knowledge-ased system program less of size and scale of operation. developments are a new area of applied poul- try science research. The results of one effort to apply expert system technology to poultry Key words: expert system, knowledge-based layer management are reported here. system, rule-based, economic loss, layer management.l, lr m. PROBLEM-SOLVING FOUNDATIONS Expert or knowledge-based computer pro- The practical and empirically verifiable di- grams are becoming an important operations agnostic rules of poultry layer management and management component of many Fortune as practiced by a cooperating poultry manage- 500 companies (Simons; Herrod) and are being ment consulting firml served as the problem- actively explored to assist smaller businesses solving paradigm used in the XLAYER pro- (Harmon et al.). They are beginning to emerge gram. These domain-dependent methods were as a field of research, development, and use in developed by consulting firms and have proven commercial agriculture (McKinion and useful over a period of years through practical Lemmon; Michalski et al.; Boulanger; Roach consulting experience. Collectively, these diag- et al.; Fermanian et al.; Spahr and Puckett; nostic rules implicitly seek to maximize layer Levins and Varner; Oltjen et al.). They also flock profitability by identifying problems represent the next logical step in the progres- which impact production performance, costs, sion of computer-supported information and and returns. They utilize problem-solving tech- decision-aid systems for farm managers first niques and data manipulations which explic- initiated by agricultural researchers in the itly and rigorously critique these separate but early 1950s. (Schmisseur and Doluschitz). interrelated areas of layer management. I The management expertise contained in the XLAYER program represents that of Mel Gehman, President and Founder of Heritage PMS, Inc., RD #3 Box 458-B, Annville, Pennsylvania 17003. Ed Schmisseur is an Associate Professor, and John Pankratz is a Courtesy Appointment, Department of Agricultural and Resource Economics, Oregon State University. Approved for publication as Technical Paper No. 8907 of the Oregon Agricultural Experiment Station. This project was financed in part by the Department of Agricultural and Resource Economics and the Oregon Agricultural Experi- ment Station, Oregon State University and Heritage PMS, Inc., of Annville, PA. Copyright 1989, Southern Agricultural Economics Association. 183 The general problem-solving approach em- financial performance, and egg gradeout. Flock bodied in the XLAYER program is relatively performance data contain livability, egg pro- straightforward. It attempts confirmation of duction, and nutrition information such as mor- all management problems contained in the know- tality, body weight, house temperature, egg ledge base by matching a list of management case weight, shell thickness, metabolizable problem symptoms with indicators of substan- energy, and protein, and the content of spe- dard flock performance. When a critical num- cific amino acids in the layer ration. Financial ber of matches occurs, a management problem performance indicators report itemized income is confirmed and a management recommen- and expense categories and net profit. Egg dation is issued. The search for management gradeout data show egg size and grade, qual- problems begins with the evaluation of pro- ity, quantity, and price information. duction decisions followed by decisions about The XLAYER program uses approximately egg marketing, and then production costs. 100 different data observations generated by The diagnostic rules, general problem- the Layer Performance program. These data, solving approach, and search strategy embod- automatically stored in a file called "Record," ied in the XLAYER program were solicited represent both actual layer performance and from the cooperating consultants. A series of equivalent performance potentials or stan- interviews with these experts dards. Performance potentials or standards are 1) identified important management problems based on standards published by commercial impacting layer flock profitability; genetic companies and breeder farms. They 2) dictated the data and the heuristics needed reflect the different layer strains, age of birds, to diagnose these problems; molting phase, and environmental conditions. 3) established the analytical or step-by-step Other data required by the XLAYER pro- procedure followed to determine problems; and gram, but not produced by Layer Perform- 4) ascertained what management recommen- ance, include information on pullet flock his- dation would be issued. tory, layer house equipment, marketing ar- After each interview, new insights about the rangements and prices, and criteria by which diagnostic process were encoded in the flock performance are compared to perform- XLAYER program and then tested using test ance standards. Pullet history information in- case data. In subsequent interviews, previ- cludes pullet weights, feed consumption, uni- ously discovered problem-solving rules were formity and shank index information at se- confirmed, new problem-solving capabilities lected weeks of rearing, and general pullet were added, and the depth of the program's rearing conditions. This information is manu- diagnostic capabilities was increased. ally entered and permanently stored in a file called "Flock Profile" when a pullet flock starts DATA REQUIREMENTS production. The XLAYER program was developed to Information about layer house equipment analyze weekly layer flock performance data includes the type of feeding, egg gathering, generated by a commercially-marketed poul- and manure handling system in the layer try management microcomputer program, house. These data, also manually entered, are Layer Performance. 2 This integration was permanently stored in a file called "Housing/ important since the consulting firm developed Equipment Profile." Layer Performance to collect and calculate Information about marketing and prices in- data useful in their diagnoses of layer man- eludes egg selling/processing arrangements, agement problems. Furthermore, many of egg prices by egg grade or case weight, and XLAYER's data needs could be obtained di- feed ingredient prices. These data are speci- rectly from data files produced by Layer Per- fled in a file called "Price Profile." Price infor- formance rather than through additional key- mation is manually updated weekly. board entries. The various criteria by which flock perform- The major types of data produced by Layer ance are compared to flock performance stan- Performance and utilized by the XLAYER dards are contained in a file called "Evalu- program are illustrated in Figure 1. The Layer ative Criteria." These criteria were obtained Performance program produces a report which from the cooperating consulting firm. They are provides weekly data on three major areas of based on experience in analyzing flock per- poultry management-flock performance, formance records. 2Layer Performance is a registered trademark of Heritage PMS, Inc., RD #3 Box 458-B, Annville, Pennsylvania 17003. 184 Layer Report Flock Egg Performance Gradeout Egg Income Profit Size/Price Production Grade Livability Nutrition Expenses Quality Figure 1. Heritage's Layer Performance Report. PROGRAM OVERVIEW infer management problems based on other known information. At each query point, us- The XLAYER program: ers can ask the XLAYER program to explain 1) identifies major management problems its reasons for the query. Also, at the end of judged to be impacting layer flock profitability; the consultation, users can query the program 2) calculates associated economic losses at- to explain how it arrived at its conclusions. tributed to major management problems; and After the XLAYER program has completed 3) issues specific management recommenda- its analysis, an "Executive Management Re- tions designed to eliminate the management port" is compiled. This report includes a brief problem. It is written using a commercially- description of each management problem, its marketed expert development and delivery associated economic loss to provoke manage- shell microcomputer program, M.1.3 The ment action and facilitate quick partial bud- XLAYER program' s code was written in the geting of the decision recommendation, and "PROLOG"-like production rule language con- specific management recommendations. If no tained in the M.1 program. The shell program management problems exist, the XLAYER requires an IBM-PC compatible microcom- program generates a brief report indicating puter equipped with a graphics card and a this finding. minimum of 320K RAM. The XLAYER program's relationship to its DIAGNOSTIC FRAMEWORK data needs and users is illustrated in Figure 2. Users execute and communicate with the A generalization of XLAYER's diagnostic XLAYER program by interacting with M.1. framework is presented in Figures 3 through The M.1 program automatically calls the 5. These diagnostics are contained in some 400 XLAYER program and immediately begins individual production rules. Diagnostics per- the consultation. During consultation, the tain to egg production, egg blend price, vari- XLAYER program automatically seeks rele- able production costs, and fixed costs. The di- vant flock performance, performance stan- agnostic framework, or fault tree, illustrates dards, and other needed data. Should data not the complexity of the inference process. It also be found, the natural language user interface shows the path of impact of management of M.1 queries the user. Users then must re- decisions made in each specific area of pro- spond. A response of "unknown" is acceptable duction. as the XLAYER program has the ability to Management decisions about layer nutrition Layer Performance Report <-1 aRecords & Standards ^ —Pro |Flock Profile U se r— Housing/Equipment Profile M.1 M. 4- |Price Profile XLAYER[_ ItXLAYER IEvaluative Criteria A- I' Questions I . | Management Report Figure 2. XLAYER's Relationship to Users and Data. 3 M.1 is a registered trademark of TEKNOWLEDGE, Inc., P.O. Box 10119, Palo Alto, California 94303. 186 depict one of the complex inferences within plementation problem can manifest itself in the XLAYER program. Nutritional decisions several performance indicators. impact egg production directly and also indi- When a methionine problem is confirmed, rectly through feed consumption (Figure 3). another XLAYER rule is invoked which actu- But, nutrition decisions also indirectly impact ally issues the management alert and pre- egg blend price through both small eggs and scribes a remedy. This rule is: egg quality (Figure 4) and indirectly impact variable production cost through feed costs f methionine and display ([Verify suspected (Figure 5). Specifically, egg quality is directly methionine imbalance in the layer ration. affected by shell quality, which in turn is im- Methionine intake should be within 20 per- pacted by nutrition decisions, and feed cost is cent of your flock's potential intake. If con- directly affected by feed consumption, which firmed reformulate the rations protein and in turn is impacted by nutrition. Similar com- methionine content. plex inferences exist for management decisions then problem. affecting environmental conditions in the layer However, before the primary rule can be house, disease, pullet quality, and stress. confirmed, either low feed consumption and The complexity of the diagnostics contained low production or small egg sizes must also be in the XLAYER program is more easily seen confirmed from other production rules con- in its diagnostic rules. For example, the pri- tained in the XLAYER program. mary rule confirming a methionine supplemen- The low feed consumption, low production, and tation problem exhibits a complex inference. small egg sizes diagnostic rules are relatively This rule and others presented also provide simple. The low feed consumption rule is: insights into the basic analytical process or problem-solving approach employed in the iffeedperhenay = FPHD XLAYER program. The rule, taken directly and goalfeedperhenday = GFPHD from the XLAYER code, is: and critical_feed_perhen_day = CFPHD and FPHD < GFPHD * CFPHD if ((low_feed_consumption and low_production) then low_feed_consumption. or (low_feed_consumption and small_egg_sizes ois unkn( onsumption and smThis rule confirms low feed consumption whenis unknown) and methionineperhenday = MPHD the amount of feed consumed per hen day is and goalmethionineperhenday = GMPHD less than the goal or standard for feed con- and uppertwidebounds p UW B sumption per hen day adjusted downward by and louer wide bounds = LWB coefficient of tolerance for feed consumption. and MPHD > GMPHD * UWB The low production rule is: or MPHD < GMPHD * LWB) if eggs_per_hen_housed = EPHH or (small_egg_sizes and goal_eggs_perhen_housed = GEPHH and methionine_per_hen_day = MPHD and critical_eggs_per_hen_housed = CEPHH and goal_methionine_per_hen_day = GMPHD and EPHH < GEPHH * CEPHH and upper_moderate_bounds = UMB and egg_blend_price = EBP and lower_moderate_bounds = LMB and starting_number_hens = SNH and MPHD > GMPHD * UMB and (((GEPHH - EPHH) * SNH)/12) * EBP = or MPHD < GMPHD * LMB) PRODL then methionine. and display( [' The rule's interpretation is: Economic losses attributed to low produc-The rule's interpretation is:The rule '£ mterpretat ' .11n tion are: ',tab(6), $(PRODL)] )1) if low feed consumption and low produc- i r tion exists and the methionine level fed per then lowproducton. hen day exceeds either an upper or lower It confirms low production when egg produc- bound, tion per hen housed is less than the standard 2) or small egg sizes exists without either for production adjusted downward by a coeffi- low feed consumption or low production and cient of tolerance for egg production, and it the methionine level fed per hen day ex- calculates the associated economic loss. This ceeds either a narrower upper or lower loss is based on the difference between the bound, egg production standard and actual egg pro- then a methionine supplementation problem duction per hen housed adjusted by the total is confirmed. It shows that a methionine sup- number of hens housed. 187 Egg Production Quality Conditions Consumption 1 Disease Pullet Disease Fright Nutrition Parasites Quality Parasites Environmental Ration Mechanical Environmental Cannibalism Conditions Formulation Equipment Conditions Prolapse Figure 3. Egg Production Diagnostic Framework of XLAYER. Egg Blend Price Market Small Practices Egg Quality Eggs I Shell Interior Quality Quality Equipment Stress Disease Candling Stress Off Taste Damage Error Discoloring mnvroma ImIn1ral [7Handling & EnvironmentalNutrition Disease Equipment Conditions Absorption Problems Low Feed Parasites Pullet Figure 4. Egg Blend Price Diagnostic Consumption Nutrition Diseases Quality Framework of XLAYER. High Variable Cost Medication High Energy Miscellaneous Labor Wage Labor Wage Costs Costs Feed Costs Costs Rate Hours Costs Feed Ingredient Consumption Costs i Interest & RepairI | + | +LDepreciation Costs Environmental Feather Conditions Wasteage Loss Nutritional Theft Figure 5. Variable and Fixed Cost Diagnostic Framework of XLAYER. The small egg sizes rule is: in new grains gradually even if the cost if caseweight = CW per pound is higher. Gradually move to and goal_caseweight = GCW the lower cost grain substitute.'] ) and critical_case_weight = CCW then problem. and CW < GCW * CCW and CaverageWblendrice = ABP Notedly absent from the diagnostic frame- and dozen_eggs_graded = DEG work are interrelationships between such fac- and potential blend_price = PBP tors as nutrition, disease, and stress. Although and (PBP - ABP) * DEG = SMALLEGGS these interrelationships are theoretically pos- and display( [' sible, the cooperating consultants did not re- Economic loss attributed to small egg sizes quire analyzing these type of interrelationships is approximately,',tab(4), $(SMALL in their consulting work and did not include EGGS), per week.'] ) them in the XLAYER program. They argued then small_egg_sizes. in today's skillfully managed commercial poul- try flocks, management problems attributed This rule confirms small egg sizes when egg to these type of interrelationships are rare. case weight is less than a case weight stan- dard adjusted downward by a tolerance level PROGRAM OUTPUTS for egg case weight. It also calculates the as- T X p sociated economic loss due to small egg sizes . The XLAYER program possesses the abil based on the difference between the egg blend t to dagnose ultiple management problems price received and the potential egg blend andrecommendmanagementactions formore price multiplied by the number of eggs graded than 80 individual layer production manage- Another type of diagnostic rule contained in ment problems. This capability is exhibited in the XLAYER program reflects a complex in- a management report displayed on screen and/the XLAYER program reflects a complex in- or printed. The report identifies management ference requiring the user to respond to a prte. The reort idifis management query about current production conditions. A problems, their associated economic loss, and simple example of this type of rule is: specifc management recommendations. An example management report appears in Fig- if (low_feed_consumption and low_production) ure 6. Specific management problems and rec- or (low_feed_consumption and ommendations related to housing and equip- small_egg_sizes) ment management, nutrition, diseases, eco- and grain_change = yes nomics, marketing practices, and general then change_grain. management practices are contained in the As this rule is being confirmed and the pre- program. conditions of either low feed consumption and Approximately 37 percent of the XLAYER low production or low feed consumption and program's diagnostics are about layer nutri- small egg sizes exist, the user is automatically tion Nutritional diagnostics include such queried about possible recent changes in the things as excessive or restrictive metabolizable type of grain used in the layer ration. The energy, calcium, and sodium supplementation, query involves two separate rule statements methionine, methionine-cystine, lysine, thre- onine, and trytophane amino acid imbalance, question(grain_change)=' improper vitamin and/or trace mineral mix Have you significantly changed the type supplementation, and poor egg shell quality of grain used in your layer ration?'. induced by improper ration formulation. legalvals(grain_change) = [yes,no]. Some 23 percent of the XLAYER program's The first of these two query rules issues a diagnostics directly address general manage- prespecified question to the user, while the ment practices. Improperly trained egg can- second provides acceptable answers and error dlers, a poorly managed poultry waste sys- checking capability to the query. tem, cage overcrowding or under-utilization, If the user responds to the questions by an- sudden changes in layer house environment, swering yes, another XLAYER rule is invoked excessive egg handling time, and egg or feed which states the management problem and of- theft represent some of the type of general fers a remedy. This rule is: management problems considered by the XLAYER program. if changegrain and display( [' Housing/equipment diagnostics account for A major change in the grain ration is about 18 percent of the XLAYER program's suspected to be causing production prob- management expertise. The XLAYER pro- lems. Reformulate your ration and phase gram identifies problems like improperly ad- 191 justed or operating mechanical egg gathering PROGRAM TESTING/VALIDATION and feeder equipment, high or low layer house The XLAYER program has been subject to temperature, low or high water consumption controlled testing with numerous test case due to malfunctioning waterers or poor well data. During initial case testing, the XLAYER water quality, limited lighting, and inadequate program's diagnostic capabilities were further ventilation. veno dti crlastion. 1 p enhanced, and its depth of knowledge was in- Economic diagnostics, representing 14 per- cresed. More than 300 individual cases, rep- cent of the XLAYER program's capability, resenting a flock's complete weekly data set, address traditional economic performance were subjected to analysis by the XLAYER problems. These include such things as high program. These cases, although carefully con- repair and maintenance, pullet rearing, labor, structed, confirmed that the program could interest, and energy costs. successfully diagnose each, as well as various Disease and marketing problems represent practical combinations, of the more than 80 the remaining diagnostic powers of the pro- layer management problems included in the gram. High broker fees, inappropriate class XLAYER program weight sales contract, respiratory diseases, Currently, it is being intensively field tested parasites, infectious coryza, fowl cholera, and with flock data from both the East and West MG disease are some of the disease and mar- coasts. In these tests weekly flock perform- keting diagnostics addressed by the XLAYER ane data are being analyzed by the XLAYER program. program and its diagnostics are compared to PROGRAM LIMITATIONS Pthose independently developed by the poultry management experts being emulated by the The XLAYER program has the potential to XLAYER program. In these limited field tests be a useful management tool, yet it has limita- with some 122,000 hens in various flock sizes, tions. Major limitations relate to the program's representing approximately 70 flock weeks of knowledge base. XLAYER's knowledge base production data, the XLAYER program has is static since the program does not possess exhibited the promising ability to perform on the ability to learn from experience. As a re- a level consistent with that of its counterpart sult, XLAYER's knowledge base must be con- poultry management experts. That is, in ap- tinually updated as new diagnostic techniques proximately 90 percent of the weekly tests, are developed and possibly new genetic bird the XLAYER program's diagnostics were strains are introduced. The magnitude of this identical to those independently prescribed by limitation is unknown. It may be mitigated the poultry management experts. because new knowledge can be added to ex- Additional field testing and more intensive pert system programs much more easily than validation with more participating flocks is modifying code in algorithmic programs. continuing. Field testing is scheduled to be XLAYER's knowledge base is also limited completed by the summer of 1990. to the diagnostic knowledge of the cooperat- ing consultants. No measure of their poultry PROGRAM AVAILABILITY management diagnostic skills has been made. The XLAYER program will be made avail- The magnitude of this limitation is also un- able to poultry managers by the cooperating known. consulting firm after extensive field testing is Economic losses attributed to low production are: $425 per week. Verify suspected high metabolizable energy level in layer ration. If confirmed, reformulate ration to reduce metabolizable energy level to your flock's standard recommended in the Layer Performance Financial Report. Also note a methionine-cystine imbalance in the layer ration. Methionine-cystine should be within 20 percent of your flock's potential intake. If confirmed, reformulate the ration's protein content and methionine-cystine supplementation. Water intake appears high. Figure 6. XLAYER's Management Report: An Example. 192 completed in the summer of 1990. The cost of gram indicates that it can substitute for scarce the program has not been established. Pro- and relatively expensive human, poultry layer gram code, excluding Layer Performance and management expertise. Its successful adoption M.1, can be obtained by contacting the authors and widespread use should increase the pro- of this article. duction efficiency of layer operations and im- rCONCLUSIONS prove producer profits. The XLAYER program also has shown that The present level of performance of the it can provide valuable management informa- XLAYER program suggests that expert sys- tion in a readily useable form to a range of tem programs have potential applied applica- flock sizes. Relative to economies of size is- tion in poultry layer management. Further- sues, this expert system program appears to more, it has been demonstrated that an ex- be size neutral. That is, it equally benefits dif- pert system program can be linked to a stand- ferent sizes of operation. If any unequal bene- alone agricultural, computerized decision- fit should occur, it is hypothesized benefits support program and can automatically and favor smaller operations because of the econo- routinely access information generated by this mies associated with making available scarce program to diagnose management problems and expensive human expertise in the more and provide insightful management advice. economical form of an expert system micro- The level of performance of the XLAYER pro- computer program. REFERENCES Boulanger, A.G. "The Expert System PLANT/cd: A Case Study in Applying the General Pur- pose Inference System ADVICE to Predicting Black Cutworm Damage in Corn." M.S. Thesis, Computer Sci. Dept., Univ. Ill., Champaign-Urbana, IL, 1983. Fermanian, T.W., R.S. Michalski, and B. Katz. "An Expert System to Assist Turfgrass Manag- ers in Weed Identification." In Proc. 1985 Summer Computer Conference. July 22-24, Chicago, IL, American Society of Agricultural Engineers, St. Joseph, MI, 1985. 499-502. Harmon, P., R. Maus, and W. Morrissey. Expert Systems Tools and Applications. New York: John Wiley and Sons Inc., 1988. Hart, A. Knowledge Acquisitionfor Expert Systems. New York: McGraw-Hill Book Co., 1986. Herrod, R.A. "Industrial Applications of Artificial Intelligence." In Proc. 1987 IEEE Western Conference on Computer Systems. June 2-4, Anaheim, CA, IEEE Computer Society Press, Washington, DC, 1987. 196-202. Levins, R.A., and M.A. Varner. "An Expert Diagnostic Aid for Reproduction Problems in Dairy Cattle." Comput. Electron. in Agric., 2(1987):47-56. McKinion, J.M., and H.E. Lemmon. "Expert Systems for Agriculture." Comput. Electron. in Agric., 1(1985):31-40. Michalski, R.S., J.H. Davis, V.S. Bisht, and J.B. Sinclair. "A Computer-based Advisory System for the Diagnosis of Soybean Diseases in Illinois." Plant Diseases, 67(1983):459-63. Oltjen, J.W., L.G. Burditt, and G.E. Selk. "Expert System for Culling Management of Beef Cows." Okla. Agric. Exp. Stn. Rpt., MP-119, 1987.85-88. Roach, J.W., R.S. Virkar, M.J. Weaver, and C.R. Drake. "POMME: A Computer-based Consul- tation System for Applied Orchard Management Using PROLOG." Expert Syst., 2(1985):56-69. Schmisseur, E., and R. Doluschitz. "Expert System Insights: Future Decision Tools for Farm Managers." J. Am. Soc. Farm Managers and Rural Appraisers, 51(1987):51-57. Simons, G.L. Expert Systems and Micros. Manchester, England: The National Computing Centre Limited, 1985. Spahr, S.L., and H.B. Puckett. "Electronics and Livestock Production." Illinois Review, 28(1986):22-25. Weiss, S.M., and C.A. Kulikowski. A Practical Guide to Designing Expert Systems. Totowa, NJ: Rowman and Allanheld, 1984. 193 194