smartfit: Using Knowledge-based Configuration for Automatic Training Plan Generation Florian Grigoleit, Peter Struss, Florian Kreuzpointner Technische Universität München Boltzmannstr. 3, 85748 Garching b. München {grigolei, struss}@in.tum.de, kf@tum.de Abstract Creating a good training plan is a very complex task, consisting The fitness industry has been booming for several decades, and of selecting and parameterizing exercises based on user parameters there is an increasing awareness of the essential impact of phys- and domain knowledge. This is analogous to configuring a system ical exercise on health. Those who are interested in exercising based on a repository of components (which are usually physical usually lack detailed knowledge about how to do this in a way building blocks or software modules), [16], and, therefore, we base that is effective and appropriate. Existing apps mainly offer a set smartfit on GECKO. Together with researchers from sports and of standard training plans that do not take all relevant individual health sciences, we created a descriptive domain theory for fitness and contextual conditions into account. The resulting effect of training. This domain theory is a specialization of generic GECKO following these apps may not only be ineffective, but even concepts and a collection of constraints on their attributes. harmful to health. Properly designed training plans, as usually In this paper, we focus on presenting the solution to configuring produced by an experienced trainer, must consider both individ- a plan for a single training session based on an initial version of the ual goals and physical abilities of the trainees to avoid adverse knowledge base. Section 2 introduces training science and moti- effects. We developed smartfit as a knowledge-based system for vates our work on generating training plans automatically. Next, generating training plans tailored to the individual trainee with- we introduce our formalization of the configuration task and the out requiring detailed knowledge. It has been developed as an key concepts of GECKO. The knowledge representation of fitness application of our generic constraint-based configuration system training is described in Section 4, while Section 5 evaluates the GECKO, which generates optimal or optimized configurations solution. Finally, we comment on our current work and some open that satisfy high-level user demands. We briefly introduce issues. GECKO, present the application problem and the domain knowledgebase, and discuss the evaluation of the current system and future work. 2 Generation of Training Plans Training science is a discipline of sport sciences focused on ana- lyzing the effects of training stimuli on the human body. The ef- 1 Introduction fects of training can vary significantly. It can enhance aerobic ca- Creating a training plan at home appears to be simple. A trainee pacity, increase flexibility, or improve strength abilities. Trainees chooses exercises and performs them. Usually, such an approach can have several reasons for training, but all have one goal in com- results in unsatisfactory training results. First, an average trainee mon: they want to enhance their physical performance. One major lacks the necessary training knowledge. Second, background insight of training science is that adaptation to training is highly knowledge regarding health and training effects, implicitly in- individual regarding the trainee. The same training stimulus can cluded in a professional training plan, is either unavailable to the have different effects on different trainees depending on the indi- average trainee or too complex for him/her to include it in a train- vidual physiological capacity. Therefore, it is very important to ing plan. For these reasons, homemade training plans tend to be train under optimal conditions with an appropriate training plan to insufficient. The same applies to most training plans available on have individual success. For this, a trainer has to select a set of the internet, which just consider very few parameters like gender exercises, the load (training weight) of the exercises, and the and training goal. This leads to an unsatisfactory training plan, amount of rest between the sets and exercises. To create a plan for which does not reflect the needs of the trainees. an individual trainee, he must consider parameters such as age or To provide trainees with effective, customized training plans the individual fitness of the trainee, because an intensive exercise with a positive impact on health, we developed a knowledge-based e.g. burpees, is well-suited for young and fit trainees, but would solution based on GECKO (Generic, constraint-based Konfigura- overwhelm and potentially even harm beginners or elderly train- tor), [9]: smartfit. smartfit is designed for trainees who want to cre- ees. With this information, two important pillars are covered: What ate plans based on deep background knowledge and which cover should I train, and how? the needs for individual personalized expectancies. Copyright © 2019 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). Elite athletes perform highly individualized training, which makes • Task: requirements and restrictions on the resulting them stronger and better. This is only possible because their train- configuration (including at least one goal specified by ers, scientific and medical advisors etc. possess the required spe- the user), such as available training equipment and cific knowledge. Common trainees do not have access to this physical properties of the trainee. knowledge. Therefore, with our work, we aim at collecting it in a Domain knowledge is expressed by constraints on (attributes of) knowledge-base and making it exploitable in the generation of in- subclasses or instances of these concepts. Figure 1 displays the dividual training plans without requiring the user to acquire the de- different types of constraints. For instance, certain parameters tailed domain knowledge him/herself. With this, we expect to con- characterizing the task may by incompatible with certain goals tribute to making exercising more effective and satisfactory to (“low body-mass-index excludes goal weight-loss”) or exclude sports amateurs and occasional practitioners. In this way, the train- some components (an injury may prevent certain exercises). There ees may avoid frustration and adverse results. are interdependencies among components (two particular exercises The starting point for creating a training plan is considering the must not appear together in a session) or goals, which can be used aim of the trainee and break it down into desired improvements in to introduce a decomposition of goals (“muscle gain” requires various fitness categories, for example strength or endurance. In “muscle gain of upper body” and “muscle gain of lower body”). addition, further information about the trainee and the training con- GECKO offers the basic constraints “requires” (implication) and ditions is necessary: age, height, weight, and gender as well as in- “excludes” (implication of negation) to represent this. formation about available equipment and training duration are re- A key part of the configuration knowledge is related to the proper quired. Further questions include: are there any health or injury selection of components given the goals stated in or resulting from concerns? What is the desired or available training frequency per the task. GECKO uses the construct of Choice to represent this: it week? Which muscle groups have to or are desired to be or trained? is a collection of components each with an associated Contribu- Training planning includes arranging the exercises within a ses- tion, a numerical or qualitative value. The contributions of the sion appropriately (obviously, the warm-up should be before the components included in a configuration are summarized by the main training). However, despite the term “planning”, no elaborate choice to deliver a certain reached AchievementLevel. The goal planning in the sense of producing complex structural and temporal which has this choice associated has an AchievementThreshold interdependencies of actions is required. The main task is selecting that needs to be reached by the AchievementLevel in order to be exercises from a repository and parameterizing them. Ordering considered fulfilled. them in an appropriate way is usually not a major problem and will Since a component may occur in several choices (an exercise af- not lead to the rejection of a set of exercises. fects several muscle groups), we obtain an m:n relationship be- tween goals and components (and introduce the potential of a com- binatorial problem). GECKO also uses choices of goals to express 3 A Generic Knowledge-based Approach how sub-goals together achieve a higher-level goal. Finally, goals may have an associated priority, which assures that to Generating Optimized Configurations the more important goals receive more contributions, and compo- nents have a cost. One important task parameter is a limit to the The main objectives of our development of GECKO are cost of the entire configuration, which typically (but not neces- • a fairly domain-independent solution to configuration problems, sarily) is the sum of the components’ costs. While cost will often • based on a small set of generic concepts that support a really mean “money”, in the training plan domain, time is the re- clear structuring of the knowledge base, source which is limited and consumed by the exercises. • allowing its use without detailed domain knowledge, Contributions and cost are the factors that allow characterizing the • considering optimality criteria. utility of selecting a component and, hence, for specifying optimal The creation of a knowledge base for a specific application system solutions and for guiding a best-first search. is done by providing • domain specific specializations of the generic concepts and specification of variables associated with them and • constraints of different types on these variables. We first briefly introduce the concepts structuring the knowledge- base, using smartfit to illustrate them, and then present the theoret- ical and algorithmic foundations (for more information, see [9]). 3.1 GECKO Concepts The three key concepts underlying the system have a straightfor- ward intuitive meaning. • Component: the elements to be chosen and included in a configuration (in smartfit: exercises), Figure 1 Constraint for configuration • Goal: achievements expected from a configuration; they can express high-level user expectations (“muscle gain”) or detailed sub-goals the user is unaware of (“bi- ceps hypertrophy”) 3.2 Consistency-based Configuration 𝐴𝐴(𝛤) ∪ 𝐶𝑜𝑛𝑓𝑖𝑔𝐾𝐵 ⊨ ∀ 𝑔𝑜𝑎𝑙 ∈ 𝑇𝑎𝑠𝑘𝐺𝑜𝑎𝑙𝑠 𝑔𝑜𝑎𝑙. 𝐴𝑐ℎ𝑖𝑒𝑣𝑒𝑑 = 𝑇 We formalize the configuration problem as identifying a subset of the components that satisfies the task specified by the user and is This view on configuration was inspired by the formalization of consistent with the configuration knowledge base ConfigKB. This consistency-based diagnosis [1], [7], where modes OK or ¬OK are can be seen as an assignment, AA, of activity to the components, assigned to the components of a system, and a diagnosis is defined which indicates the inclusion in or exclusion from the configura- as a mode assignment MA(𝛥) that is consistent with the model li- tion. brary, the structural description of the system and a set of observa- tions (which are all sets of constraints, just like ConfigKB and Definition 1 (Activity Assignment) Task): An activity assignment for a set COMPS0 ⊆ COMPS is the con- 𝑀𝑜𝑑𝑒𝑙𝐿𝑖𝑏 ∪ 𝑆𝑡𝑟𝑢𝑐𝑡𝑢𝑟𝑒 ∪ 𝑂𝑏𝑠 ∪ { 𝑀𝐴(𝛥) } ⊭ ⊥ junction AA(COMPS0) = In consequence, solutions to consistency-based diagnosis can also be exploited for generating configurations. This includes the intro- [ ⋀ 𝐴𝐶𝑇(𝑐𝑜𝑚𝑝)] duction of a utility function and the application of best-first search 𝑐𝑜𝑚𝑝∈𝐶𝑂𝑀𝑃𝑆0 to generate solution. ⋀[ ⋀ ¬𝐴𝐶𝑇(𝑐𝑜𝑚𝑝)] 3.3 Search for Optimal Configurations 𝑐𝑜𝑚𝑝∈𝐶𝑂𝑀𝑃𝑆 \𝐶𝑂𝑀𝑃𝑆0 In consistency-based diagnosis, a utility function is often based on probabilities of component modes (assuming independent failures ACT(comp) is a literal which holds when a component comp ∈ of components) ([7]) or, weaker, some order on the modes ([13]). COMPS is part of a configuration. In GECKO, we consider the contributions of components to the satisfaction of goals (possibly weighted by priorities of goals) and Definition 2 (Configuration Task) their cost. A configuration task is a pair (ConfigKB, Task) where: • ConfigKB, the knowledge base, containing the do- Definition 4 (Utility Function) main-specific objects and constraints, A function h(AA(𝛤) , Task) is a utility function for a configuration • Task is a triple (TaskGoals, TaskParameters, problem iff it is admissible for A* search. TaskRestrictions) where: • TaskGoals, is the assignment of Definition 5 (Optimal configuration) goal.Achieved=T to a set of user selected A configuration AA(𝛤) is optimal regarding a utility function goals a solution to a configuration prob- h(AA(𝛤), Task) iff for no configuration AA(𝛤′) h(AA(𝛤′), Task)is lem has to satisfy larger. • TaskParameters, domain-specific value The utility of a configuration represents the fulfillment of the re- assignments to parameters, are constants quired goals and the cost of the configuration. • TaskRestriction, user selected constraints The utility depends on its active components only. In the follow- on the activity of components ing, it is assumed that • the contribution of a configuration is obtained solely as To establish a solution to a configuration task, a set of active com- a combination of contributions of the active components ponents has to be consistent with the task and the knowledge base. included in the configuration and otherwise independent of the type of properties of the components, Definition 3 (Configuration for a Task) • the cost of the contribution is given as the sum of the cost A configuration for a Task is an activity assignment AA(𝛤) such of the involved active components and will usually be that 𝐶𝑜𝑛𝑓𝑖𝑔𝐾𝐵 ∪ 𝑇𝐴𝑆𝐾 ∪ { 𝐴𝐴(𝛤) } is satisfiable. numerical, and 𝐶𝑜𝑛𝑓𝑖𝑔𝐾𝐵 ∪ 𝑇𝐴𝑆𝐾 ∪ { 𝐴𝐴(𝛤) } ⊭ ⊥ • we can define a ratio “/” of contributions and cost. A configuration is minimal iff for no proper subset 𝛤 ′ of 𝛤 is The first defined function sums up the AchievementLevels (i.e. the AA(𝛤′) is a configuration. combined contributions of all active components) multiplied with a weight dependent on the goal priority of all active goals and di- Consistency seems to be a weak condition. After all, we want the vides this by cost of all active components. (In the definition, we configuration to satisfy the goals, not just be consistent with them. simplify the notation by writing Goal j.AchievementLevel instead But this is ensured by the definition, as stated by the following of Goalj.Choicej. AchievementLevel etc.). proposition. Intuitively, if an activity assignment yields an AchievementLevel lower than the AchievementThreshold of a Definition 6 (GECKO Utility Function) goal, it would be inconsistent with the goal.Achieved=T as re- ℎ𝑙(𝐴𝐴(𝛤, 𝐴𝑐𝑡𝐺𝑜𝑎𝑙𝑠) ≔ quired by the task. ∑𝐺𝑜𝑎𝑙 ∈ 𝐴𝑐𝑡𝐺𝑜𝑎𝑙𝑠 𝑤𝑒𝑖𝑔ℎ𝑡(𝐺𝑜𝑎𝑙𝑗 . 𝑃𝑟𝑖𝑜𝑟𝑖𝑡𝑦) ∗ 𝐺𝑜𝑎𝑙𝑗 . 𝐴𝑐ℎ𝑖𝑒𝑣𝑒𝑚𝑒𝑛𝑡𝐿𝑒𝑣𝑒𝑙 𝑗 Proposition 1 ∑𝐶𝑜𝑚𝑝 ∈𝛤 𝐶𝑜𝑚𝑝𝑖 . 𝐶𝑜𝑠𝑡 𝑖 If AA(𝛤) is a solution to a configuration task (ConfigKB, Task) then This function ignores an important aspect: If the Achieve- - TrainingGoals represent a specific aspect of fitness mentThreshold of some choice has already been reached, training, e.g. strength training, under consideration of a the utility of adding yet another component with a contribu- TraineeGoal, i.e. strength training to support weight loss. The corresponding TrainingGoal is Weight- tion to this choice is overestimated. The second utility func- Loss.Strength. tion tries to capture this by disregarding any excesses above - TargetGoals: A TargetGoal represents a single fitness the AchievementThresholds. target, i.e. a body region or a muscle, to be trained. Tar- getGoals are RegionsGoals, MuscleGroupGoals, and Definition 7 (GECKO Utility Function with contribution MuscleGoals, see Figure 2 The intensity with which it is limit) to be trained depends on the corresponding Train- ingGoal. ℎ𝑙(𝐴𝐴(𝛤, 𝐴𝑐𝑡𝐺𝑜𝑎𝑙𝑠) ≔ Goals are organized in a hierarchical structure via requires con- ∑𝐺𝑜𝑎𝑙 ∈ 𝐴𝑐𝑡𝐺𝑜𝑎𝑙𝑠 𝑤𝑒𝑖𝑔ℎ𝑡(𝐺𝑜𝑎𝑙𝑗 . 𝑃𝑟𝑖𝑜𝑟𝑖𝑡𝑦) ∗ 𝐶𝑢𝑟𝑏𝑒𝑑𝐿𝑒𝑣𝑒𝑙(𝐺𝑜𝑎𝑙𝑗 ) 𝑗 straints (Goal-Goal Constraints). Requires (x, y) is defined by ∑𝐶𝑜𝑚𝑝 ∈𝛤 𝐶𝑜𝑚𝑝𝑖 . 𝐶𝑜𝑠𝑡 𝑖 x.active=T => y.active=T, Where CurbedLevel is defined by for configuration constraints, see [9]. For example, the Train- 𝐶𝑢𝑟𝑏𝑒𝑑𝐿𝑒𝑣𝑒𝑙 eeGoal MuscleGain would require the TrainingGoals Muscle- ≔ min(𝐺𝑜𝑎𝑙𝑗 . 𝐴𝑐ℎ𝑖𝑒𝑣𝑒𝑚𝑒𝑛𝑡𝐿𝑒𝑣𝑒𝑙, 𝐺𝑜𝑎𝑙𝑗 . 𝐴𝑐ℎ𝑖𝑒𝑣𝑒𝑚𝑒𝑛𝑡𝑇ℎ𝑟𝑒𝑠ℎ𝑜𝑙𝑑) Gain.Strength and MuscleGain.Endurance. The TrainingGoals in turn require subordinate TargetGoals, as shown in Figure 4. Based on this, we can exploit best-first search and solutions that have been developed in the context of consistency-based diagnosis. Table 1: Overview of specialized GECKO concepts This includes pruning the search space based on inconsistent par- tial mode assignments that have been previously detected during GECKO Fitness Concept Example the search (called conflicts), e.g. exploiting a truth-maintenance Concept system (TMS, such as the assumption-based TMS [6]) as in SHER- Goal TraineeGoal Muscle Gain LOCK does ([8]). Classical A* search has been extended and im- TrainingGoal Strength proved by. From the diagnostic solutions, this approach has been TargetGoal Biceps generalized later as conflict-directed A* search, see [9]. Component Exercise Push-up Task Training Request - Task – TrainingDuration 90 minutes 4 smartfit Restriction ExerciseRestriction Exclude(push-up) Task – TrainingProperty Equipment In this section, we discuss the configKB for the domain of training Parameter TraineeProperty FitnessTraget.Biceps plan generation. Of course, we can present only the basic principles Configuration TrainingPlan and some typical examples for illustration purposes. We will pro- vide some details on the scope and size of the knowledge base. The conceptualization and structure of the domain knowledge is noth- ing that can be extracted from a textbook or obtained directly from interviewing experts. It is the result of major knowledge acquisi- tion efforts requiring several person years and involved sports sci- entists, professionals from the fitness business, and AI researchers. With this application, we support our claim that GECKO provides a basis for creating specific application systems by specializing the generic classes and providing a structured set of constraints, see Table 1. The presentation is restricted: • to generating a plan for one training session • as a set of exercises, i.e. without ordering them and • without their parameterization. 4.1 smartfit’s Essential Concepts Goals Goals in smartfit represent certain aspects or requirements a Figure 2: Goal-Structure for smartfit Trainee must fulfill to improve his/her fitness. The smartfit domain theory contains three hierarchically ordered types of goals: - TraineeGoals are high-level goals selected by the user. They are also the only goals that the user has to be aware of. They represent an abstract achievement the user wants to achieve, e.g. weight loss or muscle gain. strength exercises cannot be used for endurance training. An Ex- ercise contributes to a set of TargetGoals with (potentially) differ- ent levels of contribution, see Figure 5. Figure 6 shows Exercise and its associations. The exercise catalog currently contains 603 exercises. For the test cases in section 5, we used different subsets ranging from 10 to 500 exercises. Task A Task in smartfit is the triple of TraineeGoal (TaskGoal), and Trainee- and TrainingProperties (TaskParameters) and TaskRe- strictions. Task goals: one of the TraineeGoals, selected by the user. Figure 7 shows the TraineeGoals in the knowledgebase Figure 4: Expanding Goal-Structure for MuscleGain Figure 5: Component Contributions to multiple goals Figure 3 Relation Goal-Choice-Component The expanded Goal-Structure in Figure 4 shows the body regions UpperBody and Core as lowest level. The granularity of this struc- ture depends on the associated TrainingGoal and, in some cases, on the TraineeGoal. While it is necessary for strength training to break down the body region into muscle groups, such as upper leg or abdominal region, and specific muscles, e.g. biceps or triceps, this is not the case for endurance training, for which either the en- tire body or body regions, e.g. legs, are sufficiently precise. What is important to note is that only the last level or TargetGoals is con- nected to exercises (components) via requiresChoice constraints. As explained in [9], Goals can have priorities. In smartfit, priorities (domain={1,2,3,4,5}) indicate not (only) the importance of a goal, but the focus of the training. If the priority of the TrainingGoal strength is higher than the priority of endurance, more exercises and more time are required to achieve strength than for endurance. The existing knowledge base contains 8 TraineeGoals, 24 Train- Figure 6: Exercise in smartfit ingGoals (3 fitness categories * 8 TraineeGoals), 72 RegionGoals (3 body regions * 24 TrainingGoals). Table 2: Training and TraineeProperties The priority of each goal is defined in the knowledge base. If the Parameter Values priority is changed, e.g. by the training focus (see Task), the in- Age 18-40; 40-55; 55-65, 65-75; >75 crease/decrease is propagated downwards through the goal struc- Sex Male; Female ture. Body-Mass-Index <18; 18-25; 25-30; >30 Components Available Equipment Machines; free weights; … Components in smartfit are Exercises. An Exercise is an activity in Fitness Level Untrained, somewhat trained, trained, fitness training designed to train a FitnessTarget, such as the upper very trained body. A configuration, i.e. a training plan consists of a set of Exer- Working Position Sitting, standing, overhead cises selected to achieve the TraineeGoals and its subordinate Training duration 1,2,3… (given in exercises per ses- Goals. Most Exercises require preconditions to be satisfied, for ex- sion) ample Equipment, for example dumb bells, and a minimum Fit- Training Focus Body regions: upper body, core, legs nessLevel, e.g. trained, to be performed. Also, Exercises are asso- ciated with one fitness category, such as strength. This is because The trainee (user) is represented by a set of properties, including or exercise types. E.g. a high BMI prohibits body weight exercises. age, working position, body mass index (BMI) and his fitness The number of constraints necessary to encode this n*k were n is level. The parameters and their domains are given in Table 2. Each the number of applicable exercises and k is the number of relevant fitness category and each body region is associated with a fitness parameters. For the current knowledge base, this means that there level, e.g. fitnesslevel(strength.upperbody). Initially, the trainee are about 1.500 constraints. The utility for fitness training is given states either a single value after a self-assessment or performs a by Definition 6, where the cost of an exercise is given by its dura- series of fitness tests, which in the application determine the fitness tion. level of each category. Later, with feedback on the performed train- ing, the specific fitness levels are refined, so that the training plans become continuously more individual. For the training, the Trainee 5 Evaluation and Case Study can state a set of TrainingProperties, specifying the parameters of the training, these include currently the available equipment, the To debug and assess the quality of the knowledge base and the in- training duration (given in exercises) and the training focus. The fluence of goals and parameters, we performed a set of tests with focus allows to user to increase or decrease the priority of the active both hand-made and automatically generated instances of tasks. TrainingGoals and RegionGoals. Besides identifying obvious bugs in the knowledge base (such as missing components in choices, improper values of contributions 4.2 Constraints or priorities), the goal was to assess the adequacy of the generated training plans. GoalComponentConstraints We emphasize that evaluation cannot mean checking whether As discussed earlier, exercises are linked to the lowest level of smartfit generates the correct solution. There exists no single cor- goals, via component choices. A choice comprises all exercises rect or best training plan for a task. Different human trainers will that contribute to the respective goal and combines the actual con- inevitably come up with different proposals. Therefore, evaluation tributions of the active exercises during the configuration process. means that experts must analyze and argue in detail whether a gen- A component choice is achieved if the combined contributions of erated solution violates accepted principles, e.g. because it includes all active exercises exceeds the AchievementThreshold. The an inappropriate exercise or a prohibitive ordering (rather than threshold depends on the priority of the goal requiring the choice. comparing it to their own favorite plan) Figure 3 shows the relation between Goal, Component and Choice. This evaluation provides the feedback needed to tune parameters The domain of the contributions is currently given by DOM(compi.contributioni) ={20,40,60,80,100}. The utility of a used in the knowledge base and to identify missing factors and con- TrainingPlan in smartfit depends on the contributions of the active straints that influence a good training plan. The content of the do- exercises to required Choices. main knowledge, especially regarding the breaking down of goals, The AchievementThreshold of the Choices depends on the priority their interrelations with exercises and their quantification, is just a of the associated goal (24) with DOM(Priority) = {1,2,3,4}. formal model and nothing that can be simply extracted from a text- AchievementLevel = combine(Goali.Priority, normThreshold) book or guideline or would be told by a trainer. Hence, a major task The combine function for smartfit is the sum of all contributions to now is to adjust contribution values, computation of priorities to the choice. For each lowest level TargetGoal a choice is created. better approximate what is judged to be a good training plan by the There are up to 85 TargetGoals for each TraineeGoal (42 muscle experts and, beyond this, to identify limitations of the chosen rep- goals for strength, 42 muscle goals for flexibility, and 3 region resentation of the domain knowledge and the inferences used. goals for endurance). GECKO can exploit different search algorithms and constraint TaskParameterGoalconstraints solvers to generate solutions. In this case study, we used haifacsp There are TaskParameters, e.g. the working position, that are asso- [14]. ciated with Goals and their priorities. In the current knowledge- One focus of the evaluation was assessing whether the generated base, some TaskParameters can limit the priority of certain goals solutions properly reflected TaskParameters (Training- and Train- or exclude specific goals, i.e. prohibiting their achievement. The latter is applied for injuries or health problems, such as back pain eeProperties) and TraineeGoals, i.e. whether they would dedicate or a broken leg. For example, for a high BMI, the priority of a reasonable amount of accumulated contributions to the various strength goals is reduced, to avoid unhealthy stress on joints or the goals and sub-goals. In the following, we present the most im- back, and increased for endurance goals to assist weight loss. portant results and some examples. So far, there are about 20 of such TaskParameterGoalConstraints in the knowledgebase. As soon as various health issues are consid- ered, we expect this number to rise into the lower hundreds. 5.1 Assessment of parameters and goal achievement TaskParameterComponentConstraints Figure 7 shows the impact of the TraineeGoals on the accumulated Trainee and training properties have a strong impact on exercises contributions of the configurations on the fitness categories. What to be selected, mainly by excluding large sets of exercises from the Figure 7 clearly shows is that the TraineeGoals significantly influ- component catalog. The most important examples here for are fit- ence the training plans. Strength-oriented goals, such as muscle ness level and equipment. Most exercises in the catalog do not re- gain or definition, have a significantly larger contribution in quire equipment and only a low fitness level. Thus, for a beginner strength than in endurance, while more balanced goals, like general with basic equipment, the majority (more than 60%) of the catalog fitness show a more even distribution. Finally, weight loss and car- is available. On the opposite side, for advanced exercises and spe- dio contain far more endurance training than strength training. To cial equipment, only a small subset (<20%) is available. Other ex- exemplary illustrate the impact of TraineeProperties, we picked the amples are that certain TraineeProperties prohibit certain exercises parameter working position. • Training plans often contained exercises, which, seen in isolation, were correct, but in combination were too ex- haustive (see Table 5: UC1) • Training plans contained multiple versions of the same exercise, e.g. pushup and pushup with narrow arms, which is technically correct, but usually considered as faulty and inefficient by sport scientists • Training plans with goal cardio are incorrect for longer training, because of the time scale (see Table 5: UC2) 6 Discussion and Future Work Figure 7: Comparison of Training Goal Contributions GECKO has proven to be an appropriate foundation for gener- ating training plan. Most of the evaluated test cases were consid- ered as correct and fulfilled their purpose, but the assessment also showed some deficits. Table 3: Case Studies Task Variable UC1 UC2 TaskGoal TraineeGoal General Fit- Cardio ness Figure 8: Working position impact TaskRe- Duration 8 exercises 12 exer- striction cises The purpose of this parameter is to support body regions that are TaskParame- Age 35 69 especially stressed in a particular working position, e.g. sitting at a desk. The results are given in Figure 8. Figure 8 shows that the ter BMI normal over- parameter working position changes the distribution of the exercise weight contributions according to the focused region. For example, for FitnessLevel Little Trained Trained working overhead, as in construction, the focus is on the upper body, while for standing, the legs are emphasized. Available- No Equipment No Equip- Apart from technical and computational issues, it is crucial to de- Equipment ment velop a solution that users accept and that adheres to standards and Working po- sitting sitting practice from sport and training sciences. To evaluate the correct- sition ness and practicality of our solution, we created a set of test cases and used them to generate training plans. A series of 21 test cases Table 4: Generated Training Plans was assessed by a sport scientist. Focus of the initial assessment were the usability of the training plans, with the criteria: Fitness Cate- Exercises UC1 Exercises UC2 • Technical Correctness: are the plans correct gory • Intuitiveness: are the plans understandable for trainers Strength Bridge_one_leg Bridge_one_leg • Usefulness: do the plans achieve the trainee goal Sumo-squat Sumo-squat • Intensity: are the training plans appropriate for the TRX_Rollout_side TRX_Rollout_side trainee’s fitness level Endurance Plank with leg lifting Push up – positive The majority (81%) of the training plans were correct and achieved their goals. But roughly half the training plans (54%) were too in- Back lifting tensive for their respective trainees and a majority (63%) appeared Bridge unintuitive to the expert. Section 5.2 offers a details look at the Push up -single problems and potential solutions. armed rowing 5.2 Case studies Running Bridge with thera- band To illustrate the assessment of the training plans, we present two Burpees Side lifting with case studies and the conducted expert evaluation. Table 3 shows dumb bells these two cases. The results of the two exemplary case studies are shown in Table 4. The use cases were chosen for detailed discus- Burpees sion, because one (UC1) fulfills its purpose and suffers only from Flexibility Stretching latissiumus Stretching lower minor issues, while the other (UC2) fails to fulfill its goal. Stretching core back / gluteus The most common faults or anomalies (ignoring bugs in the knowledge base) the expert found were: Table 5: Expert evaluation of training plans knowledge base that incorporates all available state-of-the-art knowledge from training sciences. Use Aspects (In-)appro- Cause Poten- A related potential application, with a modified knowledge base, Case (plan/exer- priate due to tial so- would be planning of physiotherapy, following the current de- cise/combina- lution mand for highly personalized medical treatment. While in smartfit tion of exer- injuries and diseases have a restrictive impact on choosing exer- cise) cises, in this context curing them would define goals that are satis- UC1 Training Plan OK - Session fied by exercises and treatment. achieves all fitness targets TRX_Rollout_s Requires exer- Incorrect Correc- Acknowledgements ide cise entry tion of Con- We would like to thank our project partners for providing their do- figKB main knowledge and their assistance, esp. Florian Eibl from eGym Endurance ex- The combina- Intensity GmbH. Special thanks to Oskar Dressler (OCC’M Software) for ercises tion of of com- proving the constraint system (CS3) The project was funded by the burpees, plank binations German Federal Ministry of Economics and Technology under the and running is not con- ZIM program (KF2080209DB3). too exhaustive sidered References UC2 Training Plan The training Exercise [1] Kleer, J. de, Williams, B.C.: Diagnosing multiple faults. Arti- plan does not based ficial Intelligence, 32(1), pp. 97-130, (1987). fulfill the duration [2] Williams, B.C., Ragno, R.J.: Conflict-directed A* and its role trainee goal. inappro- Too many ex- priate for in model-based embedded systems. Discrete Applied Mathemat- ercises with cardio ics, 155(12), pp. 1562-1595, (2007). endurance fo- [3] Junker, U.: Configuration. In: Rossi. F., Beek, P., Walsh, T. cus, but all too (eds.): Handbook of constraint programming. 1st ed. Amsterdam, short Boston: Elsevier, (2006). Push up posi- Two variants Both ex- Group- [4] Friedrich, G.; Stumptner, M.: Consistency-Based Configura- tive/single arm of the same ercises ing vari- tion. In: Faltings, B., Freuder, E.C., Friedrich, G., Felfernig, A. Bridge/bridge exercise in the have a ants in a (eds.): Configuration. Papers from the AAAI Workshop. Menlo with theraband same plan high util- hierar- Park, California: AAAI Press (99-05), (1999). ity chy [5] Reiter, R.: A theory of diagnosis from first principles. In Arti- Bridge Not an endur- Incorrect s.a. ficial Intelligence 32 (1), pp. 57–95, (1987). ance exercise entry [6] Kleer, J.de: An assumption based TMS. In: Artificial Intelli- gence 28 (2), pp. 127–162, (1986). Currently GECKO does not offer a general mechanism for gen- [7] Struss, P., 2008. Model-based Problem Solving. In: F. von Har- erating more than one instance of each component type, which is melen, V. Lifschitz, and B. Porter, eds. Handbook of knowledge not a relevant restriction for a training plan, which should usually representation. Amsterdam: Elsevier, pp. 395-465. (Struss, 2004) avoid repeating an exercise in the same session. Struss, P. In other applications, there may be stronger constraints on the [8] Kleer J. De, Williams BC, ”Diagnosis with Behavioral Model”, structure of configurations that have to be reflected during the so- IJCAI, 1993. lution generation rather than being applied a posteriori. [9] F. Grigoleit and P. Struss. Configuration as diagnosis: Generat- Prioritization of goals is the basis for another extension, which ing configura tions with conflict-directed a* - an application to may even be relevant to smartfit: the configuration process could training plan generation. In DX@ Safeprocess, International be iteratively related to goals with decreasing priority, thus guar- Workshop on Principles of Diagnosis, pages 91–98. DX, 2015. anteeing that the most important goals are satisfied, even though the overall cost may not allow lower-priority goals to be fully ac- [11] MiniZinc is a free and open-source constraint modeling lan- complished. This also helps to break down the complexity of the guage. https://www.minizinc.org/ task. [12] SUNNY-CP: https://github.com/CP-Unibo/sunny-cp The current version of smartfit has an important limitation in [13] Dressler, O. and Struss, P.: Model-based Diagnosis with the being confined to the selection of appropriate exercises, but not Default-based Diagnostic Engine: Effective Control Strategies that fixing how the exercise has to be executed. For instance, weight- Work in Practice. In: 11th European Conference on Artificial In- based exercises can be performed with low weight and many rep- telligence, ECAI-94, 1994. etitions or vice versa and have different impacts: strength, endur- [15] HaifaCSP https://strichman.net.technion.ac.il/haifacsp/ ance or muscle gain. Integrating the assignment of such training Technion, Haifa methods to exercises is the most important extension of smartfit. [16] Felfernig A., Hotz L., Baglay C., and Tiihonen.L.: In its current version, smartfit is designed to deliver well-de- Knowledge-based Configuration from Research to Business Cases. signed training plans to trainees without detailed domain Amsterdam: Morgan Kaufmann, 2014 knowledge. In perspective, we want to extend smartfit to become a tool that can even support fitness coaches to create highly indi- vidual and complex training plans efficiently, in exploiting a