A Pedagogical Expert System for Adapted and Therapeutic Exercise: An Interdisciplinary Approach Dr. David Valentine david.valentine@sru.edu Computer Science Department Slippery Rock University Slippery Rock, PA 16057 USA Prof. Pamela Arnhold pamela.arnhold@sru.edu Exercise & Rehabilitative Sciences Department Slippery Rock University Slippery Rock, PA 16057 USA Abstract We describe an Expert System designed and implemented to teach undergraduates in an Adapted Physical Activity program how to design a safe and appropriate exercise regimen for people with physical and mental disabilities. The project is an interdisciplinary cooperation between Adapted Physical Activity and Information Systems faculty, funded by a Faculty Development Grant from the Pennsylvania State System of Higher Education (PASSHE). The system consists of a Visual Basic front end that collects and verifies some 130 data items on the client and then sends that data on to an industrial expert system shell (XpertRule Knowledge Builder) that produces a safe, conservative exercise program. Students then compare the results of the expert system with the regimen they designed manually. Generally students find the computer system to be more complete and slightly more conservative than they were. Thus students providing health-enriching exercise programs obtain valuable experience in how IS systems, especially expert systems, can be adapted to their field. The system uses fuzzy logic/fuzzy reasoning and has been verified over four semesters of the course. Keywords: Expert Systems, Health Care IS Education, VB.NET, XML 1. EXPERT SYSTEMS “Knowledge-based expert systems, or simply expert systems, use human knowledge to solve problems that normally would require human intelligence. These expert systems represent the experts’ knowledge as data or rules within the computer. These rules and data can be called upon when needed to solve problems.” [PCAI] As such, one might classify Expert Systems (ES) as “applied AI”. There are many outstanding success stories of computerized expert systems: MYCIN, XCON, DENDRAL and others are commonly cited. The fundamental difference from conventional programming is the fact that an ES must mimic the reasoning process of a human expert in some way, rather than mechanically following a static algorithm. Information Systems professionals might be more familiar with such systems under the label of Decision Support Systems (DSS): “An interactive computer-based system designed to help a person or a group of people to make decisions in a specific domain.” [Negnevitsky] Successful examples of DSS abound: digital dashboards for business, financial decision making and medical diagnosis among many others. DSS has become a mission-critical component for many businesses. Experts predict that the amount of data available to business leaders will quadruple in the next two years [Brobst], and “business intelligence” is seen as the primary weapon to manage this deluge. A cursory search of the ISECON Proceedings since 2000 shows a mere handful of presentations on either ES or DSS (actually we found just two of each). It would seem this would be a rich area for the community to explore. 2. INTERDISCIPLINARY EXPERT SYSTEMS PROJECT The project described in this paper was an interdisciplinary collaboration between faculty in the Computer Science Department and the Exercise and Rehabilitative Exercise Department at SRU. Computer Science offers an ABET-accredited degree in Information Systems, and CpSc305 Introduction to Expert Systems is an elective in that major. Recently the course has acquired academic copies of the XpertRule Knowledge Builder (XRKB) ES shell from XpertRule Software. This is an extremely powerful, professional shell used at organizations like Nissan Tokyo, NASA and United Distillers. It has added significantly to student learning in the course. Students rave about the easy drag-and-drop interface and the ease with which the shell can do fuzzy logic/fuzzy reasoning. Figure 1 ERS285 Student with client Adapted Physical Activity (APA) is a growing field of study, attracting an increasing number of students. Since 2002 it has experienced a 200% increase in student enrollment. ERS 285 Adapted and Therapeutic Exercise is a required course in that program. Its description reads: “Provides the student with practical experience in assessment of assigned clients with disabilities, program design, and administration of exercises performed in an aquatic and/or land-based setting.” It is set up as a hands-on course, where each student is assigned a client from the community who has physical and/or mental disabilities. A stereotypical client would be a person who has debilitating cerebral palsy, maybe even wheelchair-bound. The student reviews the medical and behavioral records of the client, meets with the client to assess their abilities, and then designs an exercise regimen to help that person maintain and/or increase their physical health. The student then administers that exercise program with his or her client for the rest of the semester, using SRU’s warm water pool and other equipment. Obviously client safety is of paramount importance in the course. Clients may present with medical conditions that absolutely preclude certain activities. For example, if the client has spinal rods inserted to help support her back, then no exercises should be attempted that cause the spine to twist. As a result, the proposed exercise programs are rigorously reviewed by the professor before the student is allowed to bring the client into the pool to begin the regimen. Fortunately, many of the community clients have participated in this program for years, and the faculty member has a long term relationship with them, making her very familiar with that person’s individual needs and abilities. The necessity of designing a safe, appropriate exercise program for each client was the impetus for collaboration between the professors in CpSc305 Expert Systems and ERS 285 Adapted and Therapeutic Exercise. In 2005 we obtained a PASSHE grant to design and implement an Expert System to assist APA students in designing an exercise program for their clients. The APA faculty served as the domain expert (and end user), the CS faculty took on the roles of project manager and knowledge engineer, and a student alumnus from the Expert Systems course was hired for the summer to do the coding. In many ways the team was stereotypical: the APA faculty was a self-proclaimed “computer illiterate” while the CS faculty (and student) had absolutely no knowledge of adapted exercise or assisting clients with disabilities. 3. THE PACKAGE The resulting ES does a vast amount of data collection and verification, and then recommends an exercise regimen using fuzzy logic that is tailored to that particular client’s situation. It has been used successfully for four consecutive semesters. XRKB does provide a wonderful programming interface, with simple drag-and-drop controls. Figure 2 (Appendix) shows the interface to set the fuzzy membership functions to determine “lower leg health”. Human experts normally use such fuzzy terms as “weak”, “strong” or “very strong”. XRKB allowed us to easily capture this fuzzy reasoning using Sugeno-style reasoning. Figure 3 (Appendix) shows a small set of the rules base used in the ES. This particular one illustrates the familiar “if-then-else” form commonly used to capture human expertise in rule-based systems. This particular rule assigns the fuzzy values of [weak…very strong] to the attribute “upperBodyHealth”. Notice it uses fuzzy values already assigned for the health of the left and right arms. While the programmer’s interface is a delight to operate, the team found that XRKB was not as flexible for the user interface as we might want. Because the system involves the collection and verification of some 130 data values on each client, we felt the need for a more adaptable front end to the system. We selected VB.NET for its ease of creating user interfaces. Figure 4 (Appendix) shows part of the user interface dealing with assessing the client’s range of motion (ROM) for the upper body joints. The real heart of the data collection is the student’s assessment of the ROM scores for each of the primary body joints. We used a simple Lichert scale [1..5] to capture the health of each joint. If there are medical conditions forbidding the manipulation of that joint, a score of zero is used. These ROM scores are combined with the client’s medical data to produce a fuzzy “health” status for both the upper body and lower body. Based on those fuzzy scores a set of standard exercises are recommended. Finally, the fuzzy scores are used to recommend the number of repetitions per set as well as the number of sets to attempt per session. Figure 5 Part of the Recommendation We have included part of the program recommendation for an actual client. The full recommendation runs to several pages, but this sample points out some of the important features. Notice the student is cautioned that when exercising the left elbow he should be very aware of limited motion in that joint. The report also says for this client there are contraindications that preclude any attempt to manipulate the left wrist. Contraindications could mean an injury or a pre-existing medical condition. Finally, notice that the number of repetitions and number of sets varies from joint to joint depending upon the assessed health of that joint by the ES. Public Sub writeXML(ByVal myData As cDomainData) ' Create an XmlSerializer. Saves our oDomainData data fields in an XML ' this means we can restore from disk Dim xml_serializer As New XmlSerializer(GetType(cDomainData)) 'Let user find the output file Dim dialog As SaveFileDialog dialog = New SaveFileDialog dialog.Filter = "XML Files(*.xml)|*.xml|All Files(*.*)|*.*" dialog.Title = "Select Your Data File to Write" dialog.InitialDirectory = "c:\" If dialog.ShowDialog = DialogResult.OK Then 'make the file Dim file_stream As New FileStream(dialog.FileName, FileMode.Create) xmlFileName = dialog.FileName 'save file name 'serialize myself to the data file xml_serializer.Serialize(file_stream, myData) file_stream.Close() 'close file End If End Sub ‘writeXML Figure 6 Using VB xmlSerializer An additional advantage we found was VB.NET’s ability to generate and manipulate XML data with its “XmlSerializer” object. Generating an XML file of our dataset is merely one method call in VB. This made it very easy for us to pour the data into the XRKB ES shell. We also poured an “xml island” into an HTML-based report for the students to print off. One small wrinkle was the very strict format of the XML data required by the ES. That required us to do a small parse and translation of the VB-generated XML file into a secondary XML file for the XRKB shell. Even so, the exercise was almost trivial in its simplicity because of the capabilities built into the VB.NET system. 4. USING THE SYSTEM This system has been used for the last four consecutive semesters with a total of eighty students and their clients. Early in the semester, students are brought into a computer lab on campus, given a CD with all the software and introduced to the package. Generally, they are able to enter the medical information for their clients at this time. After they meet with their client to do the initial screening, they complete the input with their screening data. At this point, each student must generate their own recommendations for their client. Once they submit their exercise regimen, we allow them to execute the ES. Figure 7 Block Diagram of System Now students can immediately compare the ES results with what they generated for the same client. This instant self-directed feedback is one of the major goals of the project. The idea is that they can immediately compare their exercise program with a program that might be created by an expert in the field (i.e. their professor). Generally, student comments indicate that they believe the ES was more complete in its recommendations and slightly more conservative than they were. Surprisingly, there have been no major modifications needed for the system, although each semester seems to reveal small, cosmetic deficiencies. Most of the technical problems resulted from the security restrictions placed on campus lab computers and from students not having the .NET Framework installed on their personal machines. Student response is almost uniformly positive, with many commenting on how they could see such a program being put to use in the field. * Very easy to use once I got it figured out. * This is AWESOME! * The ES program could make some money Faculty response was also very positive: This ES program brings a more technical aspect to working with individuals with disabilities, which is lacking in the field of APA. I like the fact that the students can create an exercise program and get immediate feedback by the ES and compare the two to create an appropriate and fun individualized program. One of our expected benefits was to model for these students how IS systems, especially expert systems, can be used in their field of providing health-enriching exercise programs for people with disabilities. The students’ comments clearly indicated success in this regard. 5. SUMMARY We assembled a cross disciplinary team to design and implement a pedagogical expert system that would design a safe and beneficial exercise program for people with mental and/or physical disabilities. VB.NET was chosen to implement the front end data collection and verification. XML was used to share that data out to both a professional expert system shell (XRKB) and an HTML-report for students to use. The XRKB system uses fuzzy logic/fuzzy reasoning to create a complete exercise regimen tailored to the particular strengths and weaknesses of the client. Students in Adapted Physical Activity have responded enthusiastically to the system. It models for them the use of IS technology, particularly Expert Systems, in their discipline. Faculty believe that having the ability to generate immediate, self-directed feedback on the quality of their recommendations has a positive impact on student learning in the course. 6. BIBLIOGRAPHY Ante, Spencer E. and McGregor, Jena. “Giving The Boss The Big Picture: A "dashboard" pulls up everything the CEO needs to run the show”. Business Week, February 13, 2006. Brobst , Stephen. “Extreme Data Warehousing: Applications & Business Issues.” Keynote address at 9th International Conference on Decision Support Systems, January 2-4, 2007, Kolkata, India Chrysler, E.  “Using Decision Tree Analysis to Develop an Expert System.”  In The Proceedings of ISECON 2005, v 22 (Columbus OH): §4113. ISSN: 1542-7382. Expert Systems. 2007. PCAI. 26 June 2007 Fraser, Steware and Livingstone, Steven. Beginning VB.NET XML. WROX Press, 2002. Gilyot, B T, W Zhang, G S Alijani, and D Thangada.  “Decision Support System: A Study of Telework Initiatives.”  In The Proceedings of ISECON 2003, v 20 (San Diego): §2234. ISSN: 1542-7382. Negnevitsky, Michael. Artificial Intelligence: A Guide to Intelligent Systems. Pearson Education Limited, 2002. Sambasivam, S E and C Davies.  “SMARTVIEW - An Intelligent Expert System Tool using JAVA and JESS Framework.”  In The Proceedings of ISECON 2004, v 21 (Newport): §3163. ISSN: 1542-7382. Stephens, Rod and Hochgurtel, Brian. Visual Basic .NET and XML. John Wiley & Sons, Inc., 2002. XpertRule Knowledge Builder. Distributed in US by Intellicrafters . Wehrs, W.  “An Applied DSS Course Using Excel and VBA: IS and/or MS?”  In The Proceedings of ISECON 2000, v 17 (Philadelphia): §602. APPENDIX Figures larger than column width Figure 2 XRKB Fuzzy Membership Functions Figure 3 XRKB Fuzzy Rule Figure 4 VB.NET User Interface