Simple Strategies for Retrospective Detection of Meals in Diabetes Datasets E. Mejia Gamarra ∗,∗∗∗ F. Reiterer ∗ P. Tkachenko ∗ P. Schrangl ∗ G. Freckmann ∗∗ W. Ipanaqu´ e ∗∗∗ ∗ Institute for Design and Control of Mechatronical Systems, Johannes Kepler University Linz, Austria (e-mail: pavlo.tkachenko@jku.at). ∗∗ Institut f¨ ur Diabetes-Technologie Forschungs- und Entwicklungsgesellschaft mbH an der Universit¨at Ulm, Germany ∗∗∗ Universidad de Piura, Department of Electronics and Automation, Urb. San Eduardo, Piura, Peru Abstract: Many model based approaches have been proposed for a personalized insulin therapy in type 1 diabetes (T1D). These approaches rely on patient-specific models of the glucose metabolism which typically need to be identified on high quality data. However, patient data recorded in an at-home setting most often do not meet this criterion, since these are based, among others, on diary entries, which are often erroneous and incomplete. The problem is especially pronounced for recordings of meal intakes which are often accidentally omitted or recorded with wrong time stamps. This paper presents two methods for meal detection based on retrospective analysis of recorded glucose traces. The first method uses the typical signal features of postprandial glucose traces and simple heuristics to detect meals, whereas the second approach relies on similarity measures of glucose traces as compared to postprandial reference profiles. Matching the meal detection results of the algorithms with the actual patient diaries, the methods presented here can be used to find complete, high quality segments in at-home data. Being able to easily distinguish between high and low quality segments in such dataset is expected to improve the reliability of identified patient models. Keywords: Diabetes, meal detection, biomedical system simulation, system identification 1. INTRODUCTION Patients with type 1 diabetes (T1D) require regular insulin injections to keep their blood glucose (BG) levels in target, which is needed for reducing the occurrence of diabetes complications. However, hypoglycemia (too low BG values) occurs in case of overdosing insulin, which is unpleasant for the patients and in the worst case can be life threatening. Estimating the required amount of insulin on a day-to-day basis is difficult and a heavy burden for patients with T1D, especially seen that there is a large intrapatient variability of BG dynamics and a myriad of factors that influence the BG level. Therefore, there is a need for tools to assist patients in this task. Great efforts have been invested in the last decades in order to develop algorithms that automatize (parts of) the insulin dosing. Most of the algorithms proposed in the scientific literature are model-based, meaning that they rely on a model of a patient’s glucose metabolism in order to optimize the insulin dosing. Different approaches have been proposed in the literature to obtain a patient-specific model rep- resentation, but often it boils down to either optimizing the parameters of a physiological model structure (see e.g. Garcia-Tirado et al. (2018)) or to using data-based approaches to identify a black-box model (see e.g. Cescon et al. (2015)). The data used for model individualization consists typically of glucose traces recorded by continuous glucose monitoring (CGM) systems together with informa- tion about meals (timing and estimated carbohydrate con- tent) and insulin injections (timing and insulin amount). The quality of the used datasets is key to obtain reliable patient representations. This is problematic since data recorded by patients during their every-day life is usually low quality. This problem holds in particular for data which are only available from patient diaries, i.e. the meal and insulin recordings. Whereas the use of insulin pumps (which are increasingly widespread among T1D patients) eliminates the need of manually logging insulin injections, meal intakes are only available from diary entries. Patient diaries, however, are often incomplete and erroneous, seen that patients forget to put data into their diary or record meals with a wrong time stamp or inaccurate estimates for the carbohydrate content. In order to obtain reliable model representations of pa- tients, it seems straightforward that only data segments that are deemed plausible should be used for identification. An algorithm that automatically preselects such segments could be a key element to make personalized model-based insulin therapy approaches better applicable for real-life situations. As a first step into this direction, the current paper introduces simple approaches for the retrospective detection of meals in recorded diabetes datasets. Meal detection algorithms (MDAs) for diabetes data have already been studied extensively. Most literature on the topic, however, deals with online detection of meals as Preprints of the 21st IFAC World Congress (Virtual) Berlin, Germany, July 12-17, 2020 Copyright lies with the authors 16601