5
EPILEPSY TREATMENT SIMPLIFIED THROUGH MOBILE KETOGENIC DIET PLANNING Hanzhou Li 1,3 , Jeffrey L. Jauregui, PhD 4 , Cagla Fenton RD, LDN 1,2 , Claire M. Chee RD, BS 1 , A.G. Christina Bergqvist M.D 1,5 1 Division of Neurology, Department of Pediatrics; 2 Department of Clinical Nutrition, The Children’s Hospital of Philadelphia, Philadelphia, PA 19104; 3 Department of Biology University of Pennsylvania, Philadelphia, PA 19104; 4 Department of Mathematics, Union College, Schenectady, NY 12308; 5 The Perelman School of Medicine, University of Pennsylvania, Philadelphia, PA 19104 Corresponding Author: [email protected] Background: The Ketogenic Diet (KD) is an effective, alternative treatment for refractory epilepsy. This high fat, low protein and carbohydrate diet mimics the metabolic and hormonal changes that are associated with fasting. Aims: To maximize the effectiveness of the KD, each meal is precisely planned, calculated, and weighed to within 0.1 gram for the average three-year duration of treatment. Managing the KD is time-consuming and may deter caretakers and patients from pursuing or continuing this treatment. Thus, we investigated methods of planning KD faster and making the process more portable through mobile applications. Methods: Nutritional data was gathered from the United States Department of Agriculture (USDA) Nutrient Database. User selected foods are converted into linear equations with n variables and three constraints: prescribed fat content, prescribed protein content, and prescribed carbohydrate content. Techniques are applied to derive the solutions to the underdetermined system depending on the number of foods chosen. Results: The method was implemented on an iOS device and tested with varieties of foods and different number of foods selected. With each case, the application’s constructed meal plan was within 95% precision of the KD requirements. Conclusion: In this study, we attempt to reduce the time needed to calculate a meal by automating the computation of the KD via a linear algebra model. We improve upon previous KD calculators by offering optimal suggestions and incorporating the USDA database. We believe this mobile application will help make the KD and other dietary treatment preparations less time consuming and more convenient. Journal MTM 3:2:1115, 2014 doi:10.7309/jmtm.3.2.3 www.journalmtm.com ORIGINAL ARTICLE #JOURNAL OF MOBILE TECHNOLOGY IN MEDICINE VOL. 3 | ISSUE 2 | JULY 2014 11

Epilepsy Treatment Simplified through Mobile Ketogenic ...articles.journalmtm.com/jmtm.3.2.3.pdf · Treatment-resistant epilepsy is a national health problem that affects up to 40%

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Epilepsy Treatment Simplified through Mobile Ketogenic ...articles.journalmtm.com/jmtm.3.2.3.pdf · Treatment-resistant epilepsy is a national health problem that affects up to 40%

EPILEPSY TREATMENT SIMPLIFIED THROUGH MOBILE

KETOGENIC DIET PLANNING

Hanzhou Li1,3, Jeffrey L. Jauregui, PhD4, Cagla Fenton RD, LDN1,2, Claire M. Chee RD, BS1,

A.G. Christina Bergqvist M.D1,5

1Division of Neurology, Department of Pediatrics; 2Department of Clinical Nutrition, The Children’s Hospital of Philadelphia,

Philadelphia, PA 19104; 3Department of Biology University of Pennsylvania, Philadelphia, PA 19104; 4Department of

Mathematics, Union College, Schenectady, NY 12308; 5The Perelman School of Medicine, University of Pennsylvania,

Philadelphia, PA 19104

Corresponding Author: [email protected]

Background: The Ketogenic Diet (KD) is an effective, alternative treatment for refractory epilepsy.This high fat, low protein and carbohydrate diet mimics the metabolic and hormonal changes thatare associated with fasting.

Aims: To maximize the effectiveness of the KD, each meal is precisely planned, calculated, andweighed to within 0.1 gram for the average three-year duration of treatment. Managing the KD istime-consuming and may deter caretakers and patients from pursuing or continuing this treatment.Thus, we investigated methods of planning KD faster and making the process more portablethrough mobile applications.

Methods: Nutritional data was gathered from the United States Department of Agriculture (USDA)Nutrient Database. User selected foods are converted into linear equations with n variables andthree constraints: prescribed fat content, prescribed protein content, and prescribed carbohydratecontent. Techniques are applied to derive the solutions to the underdetermined system depending onthe number of foods chosen.

Results: The method was implemented on an iOS device and tested with varieties of foods anddifferent number of foods selected. With each case, the application’s constructed meal plan waswithin 95% precision of the KD requirements.

Conclusion: In this study, we attempt to reduce the time needed to calculate a meal by automatingthe computation of the KD via a linear algebra model. We improve upon previous KD calculatorsby offering optimal suggestions and incorporating the USDA database. We believe this mobileapplication will help make the KD and other dietary treatment preparations less time consumingand more convenient.

Journal MTM 3:2:11�15, 2014 doi:10.7309/jmtm.3.2.3 www.journalmtm.com

ORIGINAL ARTICLE

#JOURNAL OF MOBILE TECHNOLOGY IN MEDICINE VOL. 3 | ISSUE 2 | JULY 2014 11

Page 2: Epilepsy Treatment Simplified through Mobile Ketogenic ...articles.journalmtm.com/jmtm.3.2.3.pdf · Treatment-resistant epilepsy is a national health problem that affects up to 40%

IntroductionTreatment-resistant epilepsy is a national healthproblem that affects up to 40% of patients withepilepsy and results in significant morbidity, reducedquality of life, and cost to society1�3. For thesepatients, the Ketogenic Diet (KD), a high fat, lowprotein and carbohydrate diet, remains an effectivetherapy4. More than half achieve significant seizurereduction and up to 20% become seizure-free5�8. Useof the KD also allows for reduction in medicationsand antiepileptic drug-related side effects9. As a result,the use of the KD is increasing across the world10.

Management of KD in children is time-consumingfor both the families that have to prepare the mealsand the registered dietician (RD) who supervises thediet. In order to maximize success of the KD,caretakers of the patient must follow the prescribedfat, protein, carbohydrate, and caloric intake-per-dayguidelines set by their KD team7. During the averagethree-year duration of treatment, these requirementsadjust as the child grows. Each meal is preciselyweighed to within 0.1 of a gram11. To maintain the 4:1(in grams, fat: carbohydrates plus protein) ratio, exactproportions are either computed by hand or with theassistance of one of the currently available InternetKD calculator or homemade parent calculators12,13.This requires an organized caretaker, the ability toperform some algebra, and/or large time commitmentby the RD in creating menus or in checking theaccuracy of menus created on these Internet KDcalculators. This can be a direct deterrent for a familyto try the KD, physicians from referring patients to aKD program, or result in discontinuation of thetreatment despite positive results14.

We created an automatic KD planning applicationthat is based on a linear algebra model. The mobileapplication has the ability to not only perform thecalculations, but also to offer the exact, optimalamount of each food in order to maintain theprescribed recommendations set by the dietician. Byincorporating the United States Department ofAgriculture (USDA) nutrient database, the applica-tion offers the caretakers a large selection of foodchoices instead of relying on a small set of approvedrecipes. This mobile application eliminates theburden of hand computation, offers the flexibilityof food choices, and guarantees the maintenance ofthe exact recommendation by the dietician. Theapplication is currently offered to our patients inorder to receive further feedback in terms of userinterface, design, and other improvements. Theapplication will be offered openly to the general

public on the Apple App Store in the subsequentmonths when the refinements are incorporated.

MethodsIn this study, we investigate an algorithm tocompute the quantities of food to be prepared forany ratio KD meal. We assume the user has selectedn foods, and our goal is to compute the amounteach of food, in grams, needed to fulfill the KDplan. These weights (in grams) are denoted bythe unknown variables x1, x2, ..., xn. For each i�1,2, ..., n, we consult the USDA Nutrient Database toascertain numbers ai, bi, and ci, which denote the fatper gram, protein per gram, and carbohydrate pergram, respectively, of the ith food. Finally, we let d1,d2, and d3 denote the prescribed fat, protein, andcarbohydrate content required, which are deter-mined by the size of the meal and the parametersof the diet. Equating the total amounts of fat,protein, and carbohydrates determined by the foodchoices to equal those prescribed by the diet, wearrive at the following system of linear equations:

a1x1 þ a2x2 þ � � � þ anxn ¼ d1

b1x1 þ b2x2 þ � � � þ bnxn ¼ d2

c1x1 þ c2x2 þ � � � þ cnxn ¼ d3

(1)

which can alternatively be written in matrix form as:

a1

b1

c1

a2 � � � an

b2 � � � bn

c2 � � � cn

24

35

x1

x2

..

.

xn

26664

37775 ¼

d1

d2

d3

24

35

We denote by A the coefficient matrix, x the vector ofunknowns, and b the vector consisting of d1, d2, andd3; thus, the system can be written simply as Ax�b.We apply the following methodology (Figure 1),based on the number of distinct food choices, to

Number of different foods chosen

Less than three

Least Squares Approximation

Equal to three

Exact Solution Using Inverse Matrix

Greater than three

OSEM Method

Figure 1: Algorithm For Solving Equations Depending on

the Number of Foods Chosen

ORIGINAL ARTICLE

#JOURNAL OF MOBILE TECHNOLOGY IN MEDICINE VOL. 3 | ISSUE 2 | JULY 2014 12

Page 3: Epilepsy Treatment Simplified through Mobile Ketogenic ...articles.journalmtm.com/jmtm.3.2.3.pdf · Treatment-resistant epilepsy is a national health problem that affects up to 40%

determine a solution or approximate solution x tothe above system. To reiterate, the entries of thevector x are the respective amounts of the n foods tobe given to the patient.

Less than three distinct food choicesIf the number of foods selected is less than three, thesystem of equations is overdetermined (i.e., thereare more constraints than variables). Thus, asolution will generally not exist, so we use theleast-squares method to determine an approximatesolution x by the formula:

x ¼ ðAT AÞ�1AT b

where AT is the matrix transpose of A. In practice,ATA has full rank and so its inverse exists. If anentry of x is negative, the user is warned that nofeasible solution was found, so more food choicesmust be selected.

Three distinct food choicesIf three foods are selected, the matrix A is 3-by-3.Moreover, since the food choices are distinct, Ahas full rank in practice and is therefore invertible.In particular, there exists a unique solution x, givenby the equation:

x ¼ A�1b

Again, if an entry of x is negative, the user is warnedand prompted to select more food choices.

More than three distinct food choicesIf the number of foods selected exceeds three, thesystem of equations is underdetermined. Generally,this means there are infinitely many combinationsof the selected foods that would yield a KDappropriate meal. To determine a well-defined,positive solution, we use the Ordered SubsetsExpectation Maximization (OSEM) method15.

We briefly explain the details of our OSEM im-plementation. We begin with a vector x(0)

j , wherej�1, 2, ..., n consists of all 1’s. The vector x(k)

j willdenote the vector at the kth iteration. At eachiteration step, we compute

lðkÞi ¼Xn

j¼1Aijx

ðkÞj

where i�1,2,3, followed by the iteration step

xðkþ1Þj ¼ x

ðkÞj �

P3

i¼1

Aijbi

lðkÞiP3

i¼1 Aij

We halt the iteration when the difference betweenx(k)

j and x(k�1)j is sufficiently small, and use x(k�1)

j asour solution. By construction, all of its entries arenonnegative and correspond to the suggestedamount of each food.

ResultsThe methods were implemented in an iOS applica-tion and the results are depicted in Figure 2. Thediet plan used consisted of a 4:1 ratio KD with70mg of heavy cream. Because the heavy creamamount is static, the nutritional values are simplysubtracted from the total. Figure 2 A demonstratesthe application processing two food choices: tofuand sesame oil. Figure 2 B demonstrates theapplication processing three food choices: chickentenders, hard-boiled egg, and olive oil. Figure 2 Cdemonstrates the application processing four foodchoices: mozzarella cheese, tomatoes, basil, andolive oil. From each of the figures, the totalnutrition of the meal matches closely with therecommended KD values. The green progress barindicates that the application’s constructed mealplan is within 95% precision of the KD require-ments. These results demonstrate the robustness ofthe methods in generating an appropriate, precisemeal plan given a variety of input food choices.

DiscussionThe KD is rewarding but managing it is very time-consuming. Most KD RDs have therefore movedfrom hand computation and pre-calculated mealplans to using homemade excel spreadsheets or theprograms available on the Internet such as theKetoCalculator or the Stanford Keto Calculator12,13.Many RDs also allow direct caretaker access to theseprograms but require meal plan reviews. Other KDprograms adopted an exchange system that simplifiescalculations at the expense of nutritional precision16.

Current applications such as the KetoCalculatorand other KD Excel spreadsheets prompt the userto attempt to match the KD requirements. Withthese programs the user increments the amount ofeach food until the total nutrition matches theprescribed amounts. This takes time and might notachieve the accuracy demanded by the KD. Incomparison, our mobile application can algorith-mically calculate suggested values for each fooditem. It instantaneously suggests the exact amounts.

Additionally, currently available calculators onlycontrol for the ratio, and not for the macronutrients.

ORIGINAL ARTICLE

#JOURNAL OF MOBILE TECHNOLOGY IN MEDICINE VOL. 3 | ISSUE 2 | JULY 2014 13

Page 4: Epilepsy Treatment Simplified through Mobile Ketogenic ...articles.journalmtm.com/jmtm.3.2.3.pdf · Treatment-resistant epilepsy is a national health problem that affects up to 40%

For example, they allow the user to maintain a 4:1

KD meal by replacing the protein with carbohy-

drates by adjusting accordingly to the expression

(fat) / (protein � carbohydrate). This potentially

can result in insufficient protein intake, which over

time can cause protein deficiency and poor growth

as we have seen with referred patients from other

centers seeking second opinions. Our application’s

algorithm does not allow for any deviation from

the prescribed amounts of the macronutrients,

and will function for any ratio higher or lower

than the standard 4:1. Finally, this application

utilizes the USDA database as the source for

nutritional information and therefore guarantees

accuracy and a large selection of food choices.

With this program, the meal planning process

only takes a few food selections and the click of

a button. The flexibility and convenience of

a mobile application truly makes the KD much

more manageable.

Figure 2: Example Calculations Using the Mobile Application

ORIGINAL ARTICLE

#JOURNAL OF MOBILE TECHNOLOGY IN MEDICINE VOL. 3 | ISSUE 2 | JULY 2014 14

Page 5: Epilepsy Treatment Simplified through Mobile Ketogenic ...articles.journalmtm.com/jmtm.3.2.3.pdf · Treatment-resistant epilepsy is a national health problem that affects up to 40%

ConclusionsThe Ketogenic Diet has great potential in treatingrefractory epilepsy but requires a heavy demand onthe KD staff and caretakers of the patients. Tomake the KD more manageable, we developed andimplemented a mobile application to simplify theKD. We also demonstrated that the methodologygenerates a medically acceptable meal plan as longas there exists a solution given the food choices. Byutilizing mobile technology, we are able to provideeffective medical guidance at the users’ convenience.We intend to gather further data from patientsregarding how they determine preferences betweenthe foods they choose. Then, we would createadditional optimizing constraints to improve thealgorithm. Finally, we hope this study will make theKD and other dietary treatments a practical possi-bility for more caretakers.

AcknowledgementsWe thank the Children’s Hospital of PhiladelphiaKetogenic Diet program for supporting this work.The Ketogenic diet patients inspired us to createthis program, which we hope will assist them intheir daily management of the Ketogenic diet. Thefirst author would like to thank Dr. Joshua Plotkinfor encouraging him to pursue this interest.

References1. Begley CE, Famulari M, Annegers JF, Lairson DR,

Reynolds TF, Coan S, et al. The cost of epilepsy in the

United States: an estimate from population-based

clinical and survey data. Epilepsia. 2000 Mar;41(3):342�51.

2. Kotsopoulos IA, Evers SM, Ament AJ, de Krom MC.

Estimating the costs of epilepsy: an international

comparison of epilepsy cost studies. Epilepsia. 2001

May;42(5):634�40.

3. Park C, Wethe JV, Kerrigan JF. Decreased quality of

life in children with hypothalamic hamartoma andtreatment-resistant epilepsy. J Child Neurol. 2013 Jan;

28(1):50�5.

4. Bergqvist AG, Schall JI, Gallagher PR, Cnaan A,

Stallings VA. Fasting versus gradual initiation of the

ketogenic diet: a prospective, randomized clinical trial

of efficacy. Epilepsia. 2005 Nov;46(11):1810�9.

5. Henderson CB, Filloux FM, Alder SC, Lyon JL,

Caplin DA. Efficacy of the ketogenic diet as a

treatment option for epilepsy: meta-analysis. J Child

Neurol. 2006 Mar;21(3):193�8.

6. Lefevre F, Aronson N. Ketogenic diet for the treat-

ment of refractory epilepsy in children: A systematic

review of efficacy. Pediatrics. 2000 Apr;105(4):E46.

7. Neal EG, Chaffe H, Schwartz RH, Lawson MS,

Edwards N, Fitzsimmons G, et al. The ketogenic diet

for the treatment of childhood epilepsy: a randomised

controlled trial. Lancet Neurol. 2008 Jun;7(6):500�6.

8. Levy RG, Cooper PN, Giri P. Ketogenic diet and

other dietary treatments for epilepsy. Cochrane Db

Syst Rev. 2012(3).

9. Nam SH, Lee BL, Lee CG, Yu HJ, Joo EY, Lee J,

et al. The role of ketogenic diet in the treatment of

refractory status epilepticus. Epilepsia. 2011 Nov;

52(11):e181�4.

10. Kossoff EH, McGrogan JR. Worldwide use of the

ketogenic diet. Epilepsia. 2005 Feb;46(2):280�9.

11. Mike EM. Practical guide and dietary management

of children with seizures using the ketogenic diet. Am

J Clin Nutr. 1965 Dec;17(6):399�409.

12. Zupec-Kania B. KetoCalculator: a web-based calcu-

lator for the ketogenic diet. Epilepsia. 2008 Nov;49

Suppl 8:14�6.

13. Stanford Medical Center - Ketogenic Diet Program.

Stanford University; Available from: http://www.

stanford.edu/group/ketodiet.

14. Lightstone L, Shinnar S, Callahan CM, O’Dell C,

Moshe SL, Ballaban-Gil KR. Reasons for failure

of the ketogenic diet. J Neurosci Nurs. 2001 Dec;

33(6):292�5.

15. Hudson HM, Larkin RS. Accelerated image recon-

struction using ordered subsets of projection data.

IEEE Trans Med Imaging. 1994;13(4):601�9.

16. Carroll J, Koenigsberger D. The ketogenic diet: a

practical guide for caregivers. J Am Diet Assoc. 1998

Mar;98(3):316�21.

ORIGINAL ARTICLE

#JOURNAL OF MOBILE TECHNOLOGY IN MEDICINE VOL. 3 | ISSUE 2 | JULY 2014 15