Journal of Medical Systems

, 41:142 | Cite as

Data Based Prediction of Blood Glucose Concentrations Using Evolutionary Methods

  • J. Ignacio HidalgoEmail author
  • J. Manuel Colmenar
  • Gabriel Kronberger
  • Stephan M. Winkler
  • Oscar Garnica
  • Juan Lanchares
Patient Facing Systems
Part of the following topical collections:
  1. Patient Facing Systems


Predicting glucose values on the basis of insulin and food intakes is a difficult task that people with diabetes need to do daily. This is necessary as it is important to maintain glucose levels at appropriate values to avoid not only short-term, but also long-term complications of the illness. Artificial intelligence in general and machine learning techniques in particular have already lead to promising results in modeling and predicting glucose concentrations. In this work, several machine learning techniques are used for the modeling and prediction of glucose concentrations using as inputs the values measured by a continuous monitoring glucose system as well as also previous and estimated future carbohydrate intakes and insulin injections. In particular, we use the following four techniques: genetic programming, random forests, k-nearest neighbors, and grammatical evolution. We propose two new enhanced modeling algorithms for glucose prediction, namely (i) a variant of grammatical evolution which uses an optimized grammar, and (ii) a variant of tree-based genetic programming which uses a three-compartment model for carbohydrate and insulin dynamics. The predictors were trained and tested using data of ten patients from a public hospital in Spain. We analyze our experimental results using the Clarke error grid metric and see that 90% of the forecasts are correct (i.e., Clarke error categories A and B), but still even the best methods produce 5 to 10% of serious errors (category D) and approximately 0.5% of very serious errors (category E). We also propose an enhanced genetic programming algorithm that incorporates a three-compartment model into symbolic regression models to create smoothed time series of the original carbohydrate and insulin time series.


Diabetes Glucose prediction Continuos glucose monitoring Evolutionary computation 



This work was partially supported by the Spanish Government Minister of Science and Innovation under grants TIN2014-54806-R and TIN2015-65460-C2. J. I. Hidalgo also acknowledges the support of the Spanish Ministry of Education mobility grant PRX16/00216. S. M. Winkler and G. Kronberger acknowledge the support of the Austrian Research Promotion Agency (FFG) under grant #843532 (COMET Project Heuristic Optimization in Production and Logistics).

Compliance with Ethical Standards

Conflict of interests

The authors declare that they have no conflict of interest.

Informed Consent

Informed consent was obtained from all individual participants included in the study.

Ethical Approval

All procedures performed in studies involving human participants were in accordance with the ethical standards of the institutional and/or national research committee and with the 1964 Helsinki declaration and its later amendments or comparable ethical standards.


  1. 1.
    Adaptive, Group, B. S.: ABSys JECO (Java Evolutionary COmputation) library. Available at: (2016)
  2. 2.
    Adaptive and Bioinspired Systems Group: Java evolutionary computation library (JECO). (2017)
  3. 3.
    Affenzeller, M., and Wagner, S.: Offspring selection: A new self-adaptive selection scheme for genetic algorithms. In: Adaptive and Natural Computing Algorithms, pp. 218–221. Springer (2005)Google Scholar
  4. 4.
    Affenzeller, M., Wagner, S., Winkler, S., Beham, A.: Genetic algorithms and Genetic Programming: Modern Concepts and Practical Applications. CRC Press (2009)Google Scholar
  5. 5.
    Altman, N. S., An introduction to kernel and nearest-neighbor nonparametric regression. Am. Stat. 46(3): 175–185, 1992.Google Scholar
  6. 6.
    Bakhtiani, P. A., Zhao, L. M., El Youssef, J., Castle, J. R., Ward, W. K., A review of artificial pancreas technologies with an emphasis on bi-hormonal therapy. Diab. Obes. Metabol. 15(12):1065–1070, 2013.CrossRefGoogle Scholar
  7. 7.
    Biau, G., and Scornet, E.: A random forest guided tour. TEST 25(2):197–227. doi:, 2016
  8. 8.
    Breiman, L., Random forests. Mach. Learn. 45(1):5–32, 2001.CrossRefGoogle Scholar
  9. 9.
    Clarke, WL, Cox, D, Gonder-Frederick, LA, Carter, W, Pohl, SL, Evaluating clinical accuracy of systems for self-monitoring of blood glucose. Diab. Care 10(5):622–628, 1987.CrossRefGoogle Scholar
  10. 10.
    Cobelli, C., Dalla Man, C., Sparacino, G., Magni, L., De Nicolao, G., Kovatchev, B. P., Diabetes: Models, signals, and control. IEEE Rev. Biomed. Eng. 2:54–96, 2009.CrossRefPubMedPubMedCentralGoogle Scholar
  11. 11.
    Cobelli, C., Man, C. D., Pedersen, M. G., Bertoldo, A., Toffolo, G.: Advancing our understanding of the glucose system via modeling: A perspective. IEEE Trans. Biomed. Eng. 61(5):1577–1592. doi: 10.1109/TBME.2014.2310514, 2014
  12. 12.
    Cobelli, C., Renard, E., Kovatchev, B., Artificial pancreas: Past, present, future. Diabetes 60(11): 2672–2682, 2011.CrossRefPubMedPubMedCentralGoogle Scholar
  13. 13.
    Colmenar, J. M., Hidalgo, J. I., Lanchares, J., Garnica, O., Risco, J. L., Contreras, I., Sánchez, A., Velasco, J. M.: Compilable phenotypes: Speeding-up the evaluation of glucose models in grammatical evolution. In: European Conference on the Applications of Evolutionary Computation, pp. 118–133. Springer International Publishing (2016)Google Scholar
  14. 14.
    Colmenar, J. M., Winkler, S. M., Kronberger, G., Maqueda, E., Botella, M., Hidalgo, J. I.: Predicting glycemia in diabetic patients by evolutionary computation and continuous glucose monitoring. In: Proceedings of the 2016 on Genetic and Evolutionary Computation Conference Companion, GECCO ’16 Companion, pp. 1393–1400. ACM, New York (2016),  10.1145/2908961.2931734
  15. 15.
    Colmenar, J. M., Winkler, S. M., Kronberger, G., Maqueda, E., Botella, M., Hidalgo, J. I.: Predicting glycemia in diabetic patients by evolutionary computation and continuous glucose monitoring. In: Proceedings of the 2016 on Genetic and Evolutionary Computation Conference Companion, pp. 1393–1400. ACM (2016)Google Scholar
  16. 16.
    Contreras, I., Hidalgo, J. I., Nuñez-Letamendía, L., A hybrid automated trading system based on multi-objective grammatical evolution. J. Intell. Fuzzy Syst. 32(3):2461–2475, 2017.CrossRefGoogle Scholar
  17. 17.
    Contreras, I., and Vehi, J., Mid-Term Prediction of Blood Glucose from Continuous Glucose Sensors, Meal Information and Administered Insulin, pp. 1137–1143. Cham: Springer International Publishing, 2016.Google Scholar
  18. 18.
    De Falco, I., Della Cioppa, A., Tarantino, E., A Genetic Programming System for Time Series Prediction and Its Application to El Niño Forecast, pp. 151–162. Berlin: Springer Berlin Heidelberg, 2005.Google Scholar
  19. 19.
    Dempsey, I., O’Neill, M., Brabazon, A.: Foundations in Grammatical Evolution for Dynamic Environments. Vol. 194 Springer (2009)Google Scholar
  20. 20.
    Demsar, J., Statistical comparison of classifiers over multiple data sets. J. Mach. Learn. Res. 7:1–30, 2006.Google Scholar
  21. 21.
    Doyle, F. J., Huyett, L. M., Lee, J. B., Zisser, H. C., Dassau, E.: Closed-loop artificial pancreas systems: Engineering the algorithms. Diab. Care 37(5):1191–1197. doi: 10.2337/dc13-2108, 2014
  22. 22.
    Foundation, I.D.: IDF Diabetes Atlas 2014,
  23. 23.
    Gani, A., Gribok, A. V., Rajaraman, S., Ward, W. K., Reifman, J., Predicting subcutaneous glucose concentration in humans: data-driven glucose modeling. IEEE Trans. Biomed. Eng. 56(2):246–254, 2009.CrossRefPubMedGoogle Scholar
  24. 24.
    Hansen, B., and Matytsina, I., Insulin administration: Selecting the appropriate needle and individualizing the injection technique. Expert Opin. Drug Deliv. 8(10):1395–1406, 2011.CrossRefPubMedGoogle Scholar
  25. 25.
    Hidalgo, J. I., Colmenar, J. M., Risco-Martín, J. L., Cuesta-Infante, A., Maqueda, E., Botella, M., Rubio, J. A., Modeling glycemia in humans by means of grammatical evolution. Appl. Soft. Comput. 20: 40–53, 2014. doi: 10.1016/j.asoc.2013.11.006.CrossRefGoogle Scholar
  26. 26.
    Hidalgo, J. I., Colmenar, J. M., Risco-Martin, J. L., Cuesta-Infante, A., Maqueda, E., Botella, M., Rubio, J. A., Modeling glycemia in humans by means of grammatical evolution. Appl. Soft Comput. 20:40–53, 2014.CrossRefGoogle Scholar
  27. 27.
    Hovorka, R., Kumareswaran, K., Harris, J., Allen, J. M., Elleri, D., Xing, D., Kollman, C., Nodale, M., Murphy, H. R., Dunger, D. B., et al., Overnight closed loop insulin delivery (artificial pancreas) in adults with type 1 diabetes: crossover randomised controlled studies. Bmj 342:d1855, 2011.CrossRefPubMedPubMedCentralGoogle Scholar
  28. 28.
    Hyndman, R. J., and Athanasopoulos, G.: Forecasting: Principles and practice. Online textbook (2013)Google Scholar
  29. 29.
    Keijzer, M.: Improving symbolic regression with interval arithmetic and linear scaling. In: European Conference on Genetic Programming, pp. 70–82. Springer (2003)Google Scholar
  30. 30.
    Kommenda, M., Kronberger, G., Wagner, S., Winkler, S., Affenzeller, M.: On the architecture and implementation of tree-based genetic programming in heuristiclab. In: Proceedings of the 14th Annual Conference Companion on Genetic and Evolutionary Computation, pp. 101–108. ACM (2012)Google Scholar
  31. 31.
    Koza, J. R., Genetic Programming. Cambridge: The MIT Press, 1992.Google Scholar
  32. 32.
    Ljung, L., Perspectives on system identification. Annu. Rev. Control. 34(1):1–12, 2010.CrossRefGoogle Scholar
  33. 33.
    Luke, S., Two fast tree-creation algorithms for genetic programming. IEEE Trans. Evol. Comput. 4(3):274–283, 2000.CrossRefGoogle Scholar
  34. 34.
    Moreno-Salinas, D., Besada-Portas, E., López-Orozco, J., Chaos, D., de la Cruz, J., Aranda, J., Symbolic regression for marine vehicles identification. IFAC-PapersOnLine 48(16):210–216, 2015.CrossRefGoogle Scholar
  35. 35.
    Nemenyi, P.: Distribution-free multiple comparisons. Ph.D. thesis Princeton University (1963)Google Scholar
  36. 36.
    O’Neill, M., and Ryan, C., Grammatical evolution. IEEE Trans. Evol. Comput. 5(4):349–358, 2001.CrossRefGoogle Scholar
  37. 37.
    O’Neill, M., and Ryan, C.: Grammatical evolution by grammatical evolution: The evolution of grammar and genetic code. In: European Conference on Genetic Programming, pp. 138–149. Springer (2004)Google Scholar
  38. 38.
    Oviedo, S., Vehí, J., Calm, R., Armengol, J.: A review of personalized blood glucose prediction strategies for t1dm patients. Int. J. Numer. Methods Biomed. Eng.  10.1002/cnm.2833 (2016)
  39. 39.
    Parkes, JL, Slatin, SL, Pardo, S, Ginsberg, BH, A new consensus error grid to evaluate the clinical significance of inaccuracies in the measurement of blood glucose. Diab. Care 23(8):1143–1148, 2000.CrossRefGoogle Scholar
  40. 40.
    Rechenberg, I.: Evolutionsstrategie. Friedrich Frommann Verlag (1973)Google Scholar
  41. 41.
    Santini, M., and Tettamanzi, A.: Genetic programming for financial time series prediction. In: Proceedings of the 4th European Conference on Genetic Programming, EuroGP ’01, pp. 361–370. Springer-Verlag, London (2001).
  42. 42.
    Schwefel, H. P., Evolutionsstrategie und numerische optimierung. Technische Universität Berlin: Ph.D. thesis, 1975.Google Scholar
  43. 43.
    Sparacino, G., Zanderigo, F., Corazza, S., Maran, A., Facchinetti, A., Cobelli, C., Glucose concentration can be predicted ahead in time from continuous glucose monitoring sensor time-series. IEEE Trans. Biomed. Eng. 54(5):931–937, 2007.CrossRefPubMedGoogle Scholar
  44. 44.
    Velasco, J. M., Winkler, S., Hidalgo, J. I., Garnica, O., Lanchares, J., Colmenar, J. M., Maqueda, E., Botella, M., Rubio, J. A.: Data-based identification of prediction models for glucose. In: Proceedings of the Companion Publication of the 2015 Annual Conference on Genetic and Evolutionary Computation, pp. 1327–1334. ACM (2015)Google Scholar
  45. 45.
    Wagner, S., and Affenzeller, M.: Sexualga: Gender-specific selection for genetic algorithms. In: Proceedings of the 9th World Multi-Conference on Systemics, Cybernetics and Informatics (WMSCI). Vol. 4, pp. 76–81 (2005)Google Scholar
  46. 46.
    Weissberg-Benchell, J., Antisdel-Lomaglio, J., Seshadri, R., Insulin pump therapy. Diab. Care 26(4): 1079–1087, 2003.CrossRefGoogle Scholar
  47. 47.
    Wilinska, M. E., Chassin, L. J., Schaller, H. C., Schaupp, L., Pieber, T. R., Hovorka, R., Insulin kinetics in type-1 diabetes: Continuous and bolus delivery of rapid acting insulin. IEEE Trans. Biomed. Eng. 52(1): 3–12, 2005.CrossRefPubMedGoogle Scholar
  48. 48.
    Zhao, C., Dassau, E., Jovanoviċ, L., Zisser, H. C., Doyle, F. J. III, Seborg, D. E., Predicting subcutaneous glucose concentration using a latent-variable-based statistical method for type 1 diabetes mellitus. J. Diab. Sci. Technol 6(3):617–633, 2012.CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2017

Authors and Affiliations

  1. 1.Adaptive and Bioinspired System Group, School of InformaticsUniversidad Complutense de MadridMadridSpain
  2. 2.Universidad Rey Juan CarlosMóstolesSpain
  3. 3.Heuristic and Evolutionary Algorithms LaboratoryUniversity of Applied Sciences Upper AustriaHagenbergAustria

Personalised recommendations