domain: spi info stat

text:
Taha Boussaid
email: taha.boussaid@insa-lyon.fr

François Rousset

Marc 2023 Clausse

Vasile-Marian Scuturici

An End-to-End Machine Learning Framework for District Heating Networks Simulation

Keywords: datasets, graph neural networks, surrogate modelling

Faced with environmental challenges, district heating networks have been identified as a viable solution to decarbonize the heating sector. However, they raise various challenges regarding the optimization of their control given their size and the operational constraints of the energy systems involved. As a result, the numerical simulation of these networks is computationally heavy, which hinders near-instantaneous optimal control. In this work, we present the first brick of an optimization framework for the control of district heat networks using a surrogate model based on geometric deep learning. More precisely we trained specific architectures of Graph Neural Networks to emulate a thermo-hydraulic simulator of district heating network. This statistical inference method allows us to drastically reduce simulation time by 1 to 4 orders of magnitude.

INTRODUCTION

In Europe, the production of heat and cold represents half of the energy consumption and is mainly based on fossil fuels [START_REF] Fleiter | Heat roadmap europe: eu profile of heating and cooling demand in[END_REF]. In this context, the 4th generation of district heating networks (DHN) have been identified as a viable option to decarbonize the heat production sector [START_REF] Lund | 4th generation district heating (4gdh): integrating smart thermal grids into future sustainable energy systems[END_REF][START_REF] Li | Transition to the 4th generation district heating-possibilities, bottlenecks, and challenges[END_REF] as they take advantage of various heat sources including renewable and recycled ones such as biomass, geothermal, solar thermal, and waste heat. However, the use of various heat sources, some of which are intermittent, adds a new complexity to controlling the system including the stochastic character of some variables such as resources availability, weather conditions and electricity price. Therefore, an intelligent control strategy is required in order to optimally operate these systems, such that the operational costs are reduced, the energy efficiency is maximised and the environmental impacts are limited. A detailed review on control strategies for DHN can be found in [START_REF] Vandermeulen | Controlling district heating and cooling networks to unlock flexibility: a review[END_REF]. This study shows that all these strategies make use of several simulations because of the iterative nature of control algorithms that need to understand and predict the behavior of the system and its response to various scenarios of control variables. However, physical simulators of such systems are computationally heavy as they often need to solve non linear equations (e.g. hydraulic equations). Thus, accurate and yet fast numerical models of the network's different components and their interactions are needed. Our proposition to overcome this limitation is the formulation of a numerically efficient and stable surrogate model of DHN simulation. Recently, different studies investigated the application of machine learning (ML) algorithms as surrogate models for different energy systems [START_REF] Sun | Deep learning method based on graph neural network for performance prediction of supercritical co2 power systems[END_REF][START_REF] Owerko | Optimal power flow using graph neural networks[END_REF][START_REF] Ming Ren | A tutorial review of neural network modeling approaches for model predictive control[END_REF]. For example, the study in [START_REF] Owerko | Optimal power flow using graph neural networks[END_REF] consisted on training a graph neural network (GNN) to approximate the optimal solution of power flow optimization problem for electric grids. The results showed that the surrogate model is 10 5 faster than classic optimization methods and exhibited much better scalability to larger networks. In the field of DHN control optimization, ML was applied at two different levels. The first one focuses on predicting the thermal load [START_REF] Xie | Analysis of key factors in heat demand prediction with neural networks[END_REF][START_REF] Westermann | Using a deep temporal convolutional network as a building energy surrogate model that spans multiple climate zones[END_REF] and the second, more recent, applying deep reinforcement learning to train autonomous agents to optimally operate DHN [START_REF] Zhang | A double-deck deep reinforcement learning-based energy dispatch strategy for an integrated electricity and district heating system embedded with thermal inertial and operational flexibility[END_REF]. However, to the best author's knowledge, no attempt to formulate a surrogate model of DHN simulation using ML have been made. In this paper, we present a complete pipeline that was developed for simulating DHN using spatio-temporal graph convolution neural networks (STGCN).

PROBLEM STATEMENT

The topology of a DHN can be defined using graph theory. In the development of DHN project, there are two major challenges. First a design problem, where the production power is sized with respect to the heat demand of all connected consumers, and the network topology is optimized with regards to heat losses and investment costs. The second, which is the subject of this work, is a control problem. In the latter, given a DHN with a specific topology, the objective is to simulate its dynamic response to different scenarios. A scenario corresponds to a set of exogenous and control variables. More precisely, we want to know the temperature and mass flow rates at each node of the network. Throughout this study, the DHN shown in Figure 1 is used to evaluate our approach. This choice is based on the availability of data needed by the physical simulator. The site includes buildings of different usage profiles where the number under each node indicates its index. Therefore, the topology of any DHN can be defined using graph theory. Let G = (𝑉 , 𝐸) be a graph with a set of 𝑁 nodes 𝑉 and a set of 𝑁 𝑏 edges 𝐸. Physically, the edges are the pipes of the network, while the nodes can be either consumers, producers or 3-ways valves (i.e. T junctions). More precisely, the network is completely defined through two variables:

• Incidence matrix 𝑀 ∈ R 𝑁 ×𝑁 𝑏 , which has a row for each node 𝑖 and a column for each edge 𝑗 such as 𝑚 𝑖 𝑗 = 1 if edge 𝑗 enters the vertex 𝑖, 𝑚 𝑖 𝑗 = -1 if the edge leaves the node and 𝑚 𝑖 𝑗 = 0 if the two elements are not connected. • Node type vector 𝑉 0 ∈ R 𝑁 that defines the type of each node with regard to a predefined set of supported node types within the physical simulator. Once the topology is defined, to simulate the operation of the DHN, the physical simulator then requires other physical parameters to solve the thermo-hydraulic equations (Navier Stockes and Energy balance [START_REF] Del | Models for fast modelling of district heating and cooling networks[END_REF]). Mainly, the thermo-physical properties of each branch, the heat demand at each consumer node and the external temperature. The solver then outputs the evolution of the variables of interest through a given time horizon induced from the length of heat load matrix. In our case, the variables are: incoming and outgoing temperatures (𝑇 𝑓 ,𝑇 𝑟 ) and mass flow rates 𝑚 at each node. To this purpose, and with a vision to publish it further as a data generator for DHN simulation, we developed a physical simulator. We used TESPy (Thermal Engineering Systems in Python) package [START_REF] Witte | TESPy: Thermal Engineering Systems in Python[END_REF], an open-source physical solver. To simulate both steady (i.e. constant regime) and transient (i.e. variable regime) dynamics of DHN, a customised code layer has been built upon this physical solver. The inputs of the surrogate model are heterogeneous. They are distinguished according to their static or dynamic character and then according to whether they are local or global, in other terms whether they are defined at nodes/edges levels or at the graph level. First, let H be the horizon of prediction of the surrogate model (SM) and Δ𝑡 the time-step such that H = 𝑝 × Δ𝑡 and 𝑝 the number of data points. We define:

• Static nodes attributes: here we simply map the node types to a predefined scalars set that don't change over time. This input will be noted 𝑋 𝑠 ∈ R 𝑁 • Static edges attributes: as each edge represents a pipe, the attributes are the pipe length 𝐿, inner diameter 𝐷 and its equivalent thermal resistance 𝐾𝑆, they remain constants during the simulations. Subsequently, this variable is noted 𝐸 𝑠 ∈ R 𝑁 𝑏 ×3 . • Dynamic nodes attributes: it consists of a matrix containing the temporal evolution of heat demand at each node, it will be noted 𝑋 𝑑 ∈ R 𝑁 ×𝑝 . For T-junctions and producers, the heat demand is computed as the sum of the heat load at their children nodes. • Global dynamic attributes: this input includes the control signals that affect the whole network, in our case these will be the evolution of the supply temperature 𝑇 𝑠 ∈ R 𝑝 and total mass flow rate 𝐺 𝑡𝑜𝑡 ∈ R 𝑝 . This input also holds the evolution of the external temperature along the prediction horizon 𝑇 𝑒𝑥𝑡 ∈ R 𝑝 . Finally, the inference problem can be stated as a supervised learning problem schematized in figure 2. The network topology is implicitly included during the learning phase via the adjacency list that is used by the graph attention mechanism (explained in section 3.1) in order to select the neighbors of each node.

SURROGATE MODELS

During the development phase of this framework, different types of models were evaluated for the studied problem. Here we present the two architectures offering the best performance. The choice of these architectures is the result of an extensive literature study on surrogate models and in particular graph neural networks [START_REF] Michael M Bronstein | Geometric deep learning: grids, groups, graphs, geodesics, and gauges[END_REF][START_REF] Sanchez-Lengeling | A gentle introduction to graph neural networks[END_REF][START_REF] Daigavane | Understanding convolutions on graphs[END_REF][START_REF] Li | Diffusion convolutional recurrent neural network: data-driven traffic forecasting[END_REF][START_REF] Zhao | T-gcn: a temporal graph convolutional network for traffic prediction[END_REF][START_REF] Veličković | Graph attention networks[END_REF]. The following sections show the evaluated architectures. They were implemented using Pytorch geometric package [START_REF] Fey | Fast graph representation learning with PyTorch Geometric[END_REF] and its extension for temporal models [START_REF] Benedek Rozemberczki | PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models[END_REF].

Encoder-Decoder model

The first architecture that has been explored is in the form of an encoder-processor-decoder as shown in figure 3. The encoder consists of two MLPs that transform the input data and project it into a latent space where each node is assigned two hidden vectors representing respectively its local attributes (heat demand) and also information from global variables updated with neighbors representations using three graph multi-head attention layers. The processor parts consists on transforming the node hidden representations using three multi-headed attention operations, found to be more efficient than single headed attention in [START_REF] Veličković | Graph attention networks[END_REF]. In the graph attention layer, the hidden representation of each node 𝑖 is computed as a weighted sum of its neighbors' 𝑗 ∈ N (𝑖) representations, where the weights are learned using an attention mechanism (Eq 1). Finally the decoder is composed of two linear layers that maps the nodes representation to the output space. operation is written as:

x (𝑙+1) 𝑖 = 𝜎 𝛼 𝑖,𝑖 Wx (𝑙 ) 𝑖 + ∑ 𝑗 ∈ N (𝑖 ) 𝛼 𝑖,𝑗 Wx (𝑙 ) 𝑗 , (1)
where 𝛼 𝑖,𝑗 is the attention coefficient for each neighbor 𝑗 of node 𝑖 and 𝜎 a non-linear activation function.

Recurrent model

The inference problem involves data with temporal dependencies. It is known that recurrent neural networks are suited to this type of data. Therefore, the second architecture that was implemented is a spatio-temporal graph convolution neural network (STGCN) inspired from [START_REF] Zhao | T-gcn: a temporal graph convolutional network for traffic prediction[END_REF]. In addition to the spatial convolution where the nodes exchange information with their neighbors, this model incorporates a temporal cell based on Gated Recurrent Unit (GRU) in order to update the node representations using their previous hidden states too. In figure 4, 𝐺𝐶 refers to graph convolution, which updates the node features spatially before feeding them to the GRU cell that consists of an update 𝑢 𝑡 gate, a reset gate 𝑟 𝑡 and a candidate new hidden state 𝑐 𝑡 .

x𝑡 = GraphConv (𝑥 𝑡 ) (2)
𝑟 𝑡 = 𝜎 (𝑊 𝑟 • [ x𝑡 , ℎ 𝑡 -1 ] + 𝑏 𝑟 ) (3)
𝑐 𝑡 = tanh (𝑊 𝑐 • [ x𝑡 , 𝑟 𝑡 • ℎ 𝑡 -1 ] + 𝑏 𝑐 ) (4)
𝑢 𝑡 = 𝜎 (𝑊 𝑢 • [ x𝑡 , ℎ 𝑡 -1 ] + 𝑏 𝑢 ) (5)
ℎ 𝑡 = 𝑢 𝑡 • ℎ 𝑡 + (1 -𝑢 𝑡 ) • 𝑐 𝑡 (6)

RESULTS AND DISCUSSION

The two architectures above are evaluated agains the physical model on the study case of the Figure 1. The site includes buildings of different usage profiles. Given the annual heat demand for each consumer and a typical external temperature variation, an hourly consumption profile is generated for each building using the geometric series approach implemented in demandlib library [START_REF] Möller | Demandlib: creating heat and power demand profiles from annual values[END_REF], a Python package that allows to create heat profiles from annual values. The control variables are chosen to be the supply temperature and the total mass flow rate leaving the producer node. The network operation is then simulated for one year with a time step Δ𝑡 = 10𝑚𝑖𝑛. The outputs are time series of 8760 × 6 = 52560 data points for each node, representing the evolution of temperatures. The simulation time using the physical model is equal to 𝑡 𝑠𝑖𝑚,4𝑐 = 3h2min using a 4-cores CPU processor with a 32-GB RAM. For the encoder-decoder model, we decided a split of 75% for training and 25% for validation. As this model needs a predefined time horizon of prediction, it is set to 1 week = 7 × 24 × 6 = 1008 data points. Thus, 39 weeks are used for training and 13 weeks for validation. On the other hand, as the STGCN is an auto-regressive model, we do not need to define the prediction horizon, and the same splitting is used. Without loss of generality, here we show the predictions for return temperatures only. Moreover, we plot its normalized value:

𝑇 * = 𝑇 -𝑇 𝑚𝑖𝑛 𝑇 𝑚𝑎𝑥 -𝑇 𝑚𝑖𝑛 , (7)
First, the models were evaluated on data with slow frequency control laws, i.e. supply temperature and the total mass flow rate remain almost constant for a given time span. In this case the variable having the strongest weight on the values to be predicted (forward and return temperatures) is the heat demand profile. In this case, both models performed very well in predicting the variables of interest. An example is given in Figure 5. The root mean squared error (RMSE) is used to evaluate the model performances. It can be seen from table 1 that the error stays below 0.7 Kelvin (0.7K) for all nodes, which is acceptable for the end users, i.e. network operators.

In order to test further the models adaptability and sensitivity to control laws, we tested them with new simulations where the supply temperature curve and the total mass flow rate were changed more often. Physically, this implied that the return temperature at each node was more affected by the control variables than the heat load itself. The Encoder-Decoder model was not able to capture the correct patterns as illustrated in Fig. 6. This limitation originates from an imbalance between the two encoding blocks where the local MLP seems to affects more the prediction. On the other hand, the STGCN model captured well enough the system dynamics as shown in Fig. 7. This is the direct result of using GRU to better incorporate the notion of temporality and time dependence into the inference function.

In Figure 8 we compare the two models using RMSE over each node in the validation dataset. This confirms that temporal dependencies are a key feature to have in the surrogate model as the STGCN clearly outperforms the Encoder-Decoder model. This result is consistent with the physics of DHN, which are known to have a big inertial effect. However, the inference time is different for both models. To simulate one week of operation, the Encoder-Decoder model needs 𝑡 𝑖𝑛𝑓 𝑒𝑟𝑒𝑛𝑐𝑒 = 0.019𝑠 against 𝑡 𝑠𝑖𝑚,4𝑐 = 336𝑠 for the physical simulation on the validation dataset which accounts for approximately 1.8 × 10 4 time gain. On the other hand, the STGCN model needs 𝑡 𝑖𝑛𝑓 𝑒𝑟𝑒𝑛𝑐𝑒 = 7.71𝑠, this accounts for approximately 43 time gain. Finally, although these results need further analysis, and deeper sensitivity and ablation studies, they suggest that a combination of the two models with regards to the variations of the control laws may be a good compromise between fast computation and accurate predictions.

CONCLUSION

In this paper, we presented a work in progress for the application of geometric deep learning as framework for surrogate modeling of district heating networks simulation. The bottleneck to control such systems is their heavy simulations. Therefore, the aim of the surrogate model is to reduce computation time while preserving a high accuracy. Depending on the architecture, the time gain varies in our experiences from a factor of 43 to 1.8 × 10 4 . The next line of work At nodes : 𝑇 𝑓 , 𝑇 𝑟 , ሶ 𝑚 𝑡 𝑒 (2) 𝑒 (3)

A cell of T-GCN model

Figure 1 :

 1 Figure 1: DHN topology of the study case adapted from [1]. The site includes buildings of different usage profiles.

Figure 2 :

 2 Figure 2: Supervised learning problem to train the surrogate model

3 Figure 3 :

 33 Figure 3: Surrogate model encoder-processor-decoder architecture

Figure 4 :

 4 Figure 4: Spatio-temporal model architecture. The STGCN cell schematic is adapted from [22].

Table 1 :

 1 RMSE for return temperatures prediction on validation dataset for the Encoder-Decoder model the analysis of these models and to fuse more physical constraints during the training phase to respect the physical laws in the predicted values.

Figure 5 :

 5 Figure 5: Normalized temperature (𝑇 * ) prediction over 1 week for node 13 using Encoder-Decoder model with moderate control laws, in this case the supply temperature remains constant.

Figure 6 :

 6 Figure 6: Normalized temperature (𝑇 * ) prediction over 1 week for node 13 using Encoder-Decoder model and with sharp control laws. The model doesn't capture well the dynamics of the DHN system.

Figure 7 :

 7 Figure 7: Normalized temperature (𝑇 * ) prediction over 1 week for node 13 using STGCN model and with sharp control laws

Figure 8 :

 8 Figure 8: Comparison of Encoder-Decoder and STGCN performances for each node in the studied DHN.

39th BDA conference, October 23-26, 2023, Montpellier, France 2023.

ACKNOWLEDGMENTS

This work was supported by the French Ministry of Higher Education and Research.


Vincent Le Cam

Frédéric Bourquin

de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Localisation principle

Detection is possible by means of 3 acoustic sensors labelled 1, 2, 3 according to the time of arrival of the wave generated by the break. Sensors 1 and 2 receive the wave first. Break occurred between sensors 1 and 2. The wave speed is computed as :

V = L 31 / t 31
and the distance between the break location and sensor 1 Writes :

X = ½* (L 12 -V * t 12 )
where t jk denotes the difference between the time of arrival at sensors j and k.

Detection principle

New developments

New In view of safety, structure durability and cost efficiency, detection of wire breaks is a strategic component of cable monitoring. Knowing the number of breaks and their location contributes to understand the health of the structure. Acoustic emission emerges as one of the favourite non-destructive evaluation technique. LCPC develops wire and wireless acoustic sensors that provide a reliable cable health monitoring.

CABLE MONITORING

Break detection & localisation by acoustic sensors

Wireless platform

Supervisor Wifi Sensor



  wireless sensor network, based on DSP and the emerging TCP/IP wireless protocol : WIFI Enabled functionalities  Accept heterogeneous measured data  Record the full signal signature when wire breaks occur  Organise the monitoring in an event-driven process Vincent Le CAM (vincent.lecam@lcpc.fr) Sensors are 10 m equispaced  Ruptures are detected with an accuracy of +/-15 cm  The system provides alarms to bridge operator and successfully predicted critical health of bridges in service


Johan Henaff

Matthieu Ansquer

Miguel C Soriano

Roberta Zambrini

Nicolas Treps

Valentina Parigi

Optical phase encoding in pulsed approach to reservoir computing

The exploitation of the full structure of multimode light fields enables compelling capabilities in many fields including classical and quantum information science. We exploit data-encoding on the optical phase of the pulses of a femtosecond laser source for a photonic implementation of a reservoir computing protocol. Rather than intensity detection, data-reading is done via homodyne detection that accesses combinations of amplitude and phase of the field. Numerical and experimental results on NARMA tasks and laser dynamic predictions are shown. We discuss perspectives for quantum enhanced protocols.

Reservoir computing is a supervised machine learning approach to time series processing, rooted in recurrent neural networks [START_REF] Lukoševičius | Reservoir computing approaches to recurrent neural network training[END_REF][START_REF] Nakajima | Reservoir computing: Theory, physical implementations, and applications[END_REF]. Inspired by the brain mechanisms, many interconnected artificial neurons process input information and display an internal memory. Recurrent neural networks are then suitable for temporal tasks such as speech recognition [START_REF] Verstraeten | Reservoir-based techniques for speech recognition[END_REF][START_REF] Larger | High-Speed Photonic Reservoir Computing Using a Time-Delay-Based Architecture: Million Words per Second Classification[END_REF], but at the expense of being hard to train. All the weights of the networks need indeed to be trained using backpropagation through time [START_REF] Werbos | Backpropagation through time: what it does and how to do it[END_REF], a time-consuming and not always converging, procedure [START_REF] Doya | Bifurcations in the learning of recurrent neural networks 3[END_REF]. Differently, in the reservoir computing (RC) approach only the weights of the output layer are trained to process information [START_REF] Jaeger | Harnessing Nonlinearity: Predicting Chaotic Systems and Saving Energy in Wireless Communication[END_REF][START_REF] Jaeger | The "echo state" approach to analysing and training recurrent neural networks-with an erratum note[END_REF]. Those architectures are composed of three elements: an input layer to inject the data into the system, a reservoir composed of a large number of neurons (or nodes) randomly connected, and an output (or reading) layer to extract the information from the reservoir. Under certain conditions on the reservoir, training the output layer with a simple linear regression can be sufficient [START_REF] Lukoševičius | Reservoir computing approaches to recurrent neural network training[END_REF][START_REF] Jaeger | The "echo state" approach to analysing and training recurrent neural networks-with an erratum note[END_REF].

In this paper, we present the design of a reservoir computing protocol using a single non linear node with delayed feedback as in [START_REF] Appeltant | Information processing using a single dynamical node as complex system[END_REF]. While recent works have successfully implemented reservoir and neuromorphic computing via the frequency components of optical frequency combs [START_REF] Xu | Neuromorphic computing based on wavelength-division multiplexing[END_REF][START_REF] Butschek | Photonic reservoir computer based on frequency multiplexing[END_REF][START_REF] Lupo | Deep photonic reservoir computer based on frequency multiplexing with fully analog connection between layers[END_REF], here we exploit the time features, i.e. the pulses basis, of an optical frequency comb as nodes of the reservoir. Moreover coherent homodyne detection is used, so that information can be encoded in the phase components of the field rather than its intensity or amplitude. We show that despite a small number of nodes and a low non-linearity, our protocol has good performances, displaying both nonlinear memory and forecasting capabilities. Our system builds on the notion that optical pulses can be used to build spiking reservoirs [START_REF] Owen-Newns | Ghz rate neuromorphic photonic spiking neural network with a single vertical-cavity surface-emitting laser (vcsel)[END_REF][START_REF] Owen-Newns | Photonic spiking neural networks with highly efficient training protocols for ultrafast neuromorphic computing systems[END_REF] and that phase encoding for information injection can yield to better performance in photonic reservoir computers [START_REF] Bauwens | Influence of the input signal's phase modulation on the performance of optical delay-based reservoir computing using semiconductor lasers[END_REF][START_REF] Kanno | Reservoir computing based on an external-cavity semiconductor laser with optical feedback modulation[END_REF].

Optical based computing [START_REF] Mcmahon | The physics of optical computing[END_REF] might be able to give speed or energy-efficiency benefits over electronics.

Among the peculiar features of optical systems for computing, time and frequency multiplexing can be exploited in our system. In addition, the large signal-to-noise ratio characteristics of the detection pave the way for quantum protocols [START_REF] Mujal | Opportunities in quantum reservoir computing and extreme learning machines[END_REF] by exploring quantum features of the optical states. Recently demonstrated frequency and timemultiplexed quantum platforms [START_REF] Kouadou | Spectrally shaped and pulseby-pulse multiplexed multimode squeezed states of light[END_REF][START_REF] Roman-Rodriguez | Spectrally multimode squeezed states generation at telecom wavelengths[END_REF] can then be exploited in promising protocols [START_REF] Nokkala | Gaussian states of continuous-variable quantum systems provide universal and versatile reservoir computing[END_REF][START_REF] García-Beni | Scalable photonic platform for real-time quantum reservoir computing[END_REF].

In a delayed feedback RC architecture, the reservoir is composed of virtual neurons distributed in time in a feedback loop [START_REF] Appeltant | Information processing using a single dynamical node as complex system[END_REF] and only one neuron is accessible at a time. Each neuron is separated from the others by a time interval θ. In the following, we consider V neurons labeled by j. The time-span of the reservoir, τ , is equivalent to its size. It is given by τ = V θ. To process a time sequence u(t), the signal is sampled according to u k = u(t = kT s ), where T s is the sampling time and k ∈ [1 : L], with L the length of the input sequence. Each data point u k is distributed on every node in the time-span of the reservoir. As illustrated in Fig. 1 (input layer), this is achieved by applying a mask function m(t j ) to u k . This mask is composed of V individual steps of duration θ so that m j = m(t j = jθ) [START_REF] Ortín | Time delay systems for reservoir computing[END_REF]. The state of neuron r j,k , corresponding to the j th node for the data point k, at time t j = kτ + jθ, is given by a non-linear function of the sum of input data and the previous state of the reservoir r j,k-1 . The specific description of our reservoir system is detailed later in Eq. 4.

The state of the reservoir is extracted at the output layer y k , given by a simple linear combination of the reservoir neuron values:

y k = W T out r k , (1)
where r k is the vector of V neurons (measured signals), W out is the vector containing the output weights, and T stands for the transposition of the vector column.

To perform the supervised training, a set of data of length L train is taken. The reservoir states r k and the target data ŷk for the full set of training data are re-arXiv:2401.14073v1 [quant-ph] 25 Jan 2024

grouped in the vectors R = (r 1 , • • • r Ltrain ) and ŶT = (ŷ 1 , • • • , ŷLtrain ).
The training procedure is then reduced to the inversion of a matrix so that W ⋆ out , the trained set of output weights, is given by W ⋆ out = ŶR -1 . Note that in practice more complex transformations are used, such as Ridge regression [START_REF] Lukoševičius | Reservoir computing approaches to recurrent neural network training[END_REF], to prevent the protocol from overfitting. The accuracy of the training is assessed on a new set of data, called test-set, of length L test . It is given by computing an error function such as the normalized root mean squared error, or a correlation coefficient such as Pearson coefficient.

As previously mentioned, in this work, the reservoir is composed of a succession of laser pulses. The information is encoded in the phase of each pulse and extracted using homodyne detection. In the following, we derive the expressions corresponding to the experimental configuration presented in Fig. 1.

To describe the experiment, let us start with the expression of the electric field of one pulse given by E (+) pulse (t) = E 0 a(t)e -iω0t . Even though a high bandwidth detector is used to measure the field pulse by pulse, this detector is not fast enough to resolve the pulse shape. In addition, one data point is taken for each pulse. Thus, we consider that each pulse has some average amplitude a. The information, i.e the input data, can be encoded in the two degrees of freedom of the pulses, their amplitude or their phase. In [START_REF] Nokkala | Gaussian states of continuous-variable quantum systems provide universal and versatile reservoir computing[END_REF], Nokkala et. al. investigated several RC protocol architectures with different encoding for the input data. In particular, encodings into the amplitude or the phase of a coherent state were compared. They demonstrated numerically that phase encoding can lead to better performance. Therefore, using the fact that under certain conditions the laser field can be assimilated to a coherent state, we choose to encode the information in the phase of the pulses. Hence, the field of the j th pulse at the time step k is multiplied by a phase term containing the injected data at step k and the measurement done at step k -1 according to

E (+) j,k = E 0 a exp [i(βm j u k + αM k-1,j )] , (2)
where E (+) j,k is the complex field amplitude of the pulse at time t n = kτ + jθ. As shown in the experimental scheme in Fig. 1, data m j u k are summed to homodyne measurements M k-1,j at step k -1 via a mixer, in order to provide memory to the system. The gain parameters α and β are set by electronic transfer functions and can be used to optimize the protocol. The homodyne detection measurement M k,j of the node j at time step k, providing the necessary non-linearity for the protocol to work, is then given by:

M k,j = C sin(βm j u k + αM k-1,j ), ( 3
)
where C is a constant depending on the detector characteristics and the experimental conditions. In order to create links between the virtual nodes of the reservoir, we use the finite bandwidth of the system. As it will be detailed later, the homodyne detector has a response time that is a bit slower than the pulse repetition rate corresponding to the node separation (θ = T r ≃ 6.4 ns). The bandwidth of the detection determines the parameter T BW of the protocol. In addition, low-pass filters can be added after the detector to reduce even more the effective bandwidth T BW and tune the parameter T r /T BW . This ratio determines the corresponding graph connectivity of the reservoir [START_REF] Brunner | Tutorial: Photonic neural networks in delay systems[END_REF]. Consequently, the measurement of the node j at time step k is given by

     M k,j ≃ C sin(ϕ k,j-1 )e -Tr/T BW +C sin(ϕ k,j )(1 -e -Tr/T BW ) ϕ k,j = βm j u k + αM k-1,j (4)
From equation ( 4), we see that each node is connected to a few previous nodes with different strengths. Those connections depend on the ratio T r /T BW . Changing this ratio modifies the influence of a given node on the future ones.

The scheme of the experimental setup is further illustrated in Fig. 1. As usual in homodyne detection, the field from the laser is split into two, a weak beam, the signal, and a strong beam, the local oscillator (LO). The phase encoding is achieved using an electro-optic modulator (EOM) on the signal arm. By applying a voltage to this modulator, the phase of each pulse can be modified to encode the information. This EOM is driven from a computer via an arbitrary waveform generator (AWG). For simplicity, we decided to implement the feedback electronically as in [START_REF] Appeltant | Information processing using a single dynamical node as complex system[END_REF] and not optically as in [START_REF] Brunner | Parallel photonic information processing at gigabyte per second data rates using transient states[END_REF]. An optical feedback would require an optical loop. Such loops are usually built using fiber elements, which are not easy to handle with femtosecond pulses, mainly due to chromatic dispersion. As long delays are difficult to handle in free space, we have chosen the electronic feedback. This is achieved by first detecting the electric field after the encoding via an homodyne detection, which is equivalent to measuring the nodes of the reservoir. The detection is performed by a home-made high-bandwidth balanced detector. Its bandwidth is approximately 100 MHz and details about this detector can be found in [START_REF] Tiphaine | Single-Pass Generation and Detection of Ultrafast Multimode Squeezed Light[END_REF]. To create the links between the nodes, a low pass filter is introduced after the detection (T BW ≃ 21ns). After detection, the measured signal is split in two. A small part is gathered for off-line processing and the other part is sent in a long coaxial cable to create the feedback loop that provides the reservoir memory. The delayed signal is finally mixed with the input signal from the AWG to be sent to the EOM, creating the feedback loop. At the time of the experiment, the longest cable in the lab with sufficiently low losses could only handle a delay corresponding to V=35 nodes thus defining the size and corresponding maximum memory available to the RC system.

To characterize the computing abilities of the setup, we first report the results for an academic benchmark, namely the NARMA (Nonlinear AutoRegressive Moving Average) task. It involves predicting the next output value in a sequence based on a non-linear combination of past output values and input data. It is defined by [START_REF] Atiya | New results on recurrent network training: unifying the algorithms and accelerating convergence[END_REF][START_REF] Jaeger | Adaptive nonlinear system identification with echo state networks[END_REF] y(t) = 0.3y(t -1) + 0.05y(t -1)

t i=t-N y(i) + 1.5u(t -1)u(t -N ) + 0.1, (5)
where the input u is taken from a uniform random distribution in the interval [0, 0.5]. The parameter N determines how many time steps in the past of inputs in u influence the current output y. The drawn sequence u is used as the input to our reservoir, which is then trained on the corresponding target output y. The performance of the protocol is evaluated by the Pearson correlation coefficient between the NARMA-N value y and the predicted value ȳ.

As shown in Fig. 2, for a small value of input delay parameter (N = 2) the experimental RC protocol can approximate the target data. The accuracy of the approximation decreases monotonically for higher values of N as shown in Fig. 3 (solid line). In addition to the optical experimental protocol, we performed numerical simulations. They are run according to Eq. ( 4), given the known characteristics of the experiment (e.g. detection noise, sampling rate in acquisition). We find that the performances of the experimental setup are qualitatively similar to the simulated ones, see dashed black line in Fig. 3. The discrepancies between experiment and simulation may be due to the presence of other experimental noise sources, such as phase drifts, not accounted for in the numerical simulations. It is also worth mentioning that the α and β parameters can be finely tuned in the simulation while in the experiment the α parameter was set with an electronic attenuator that didn't allow fine tuning, therefore we couldn't reach identical (α, β). Even though a quantitative agreement is not possible, the numerical simulations allows us to estimate the impact of an increasing reservoir size. The red line in Fig. 3 indicates that the error in the NARMA-N task is greatly reduced when the number of nodes is increased to 100. Similar trends can be expected to happen if the reservoir size could be increased in the experimental implementation.

To give an example of a practical application of this machine learning protocol, following the idea of [START_REF] Amil | Machine learning algorithms for predicting the amplitude of chaotic laser pulses[END_REF][START_REF] Cunillera | Crosspredicting the dynamics of an optically injected singlemode semiconductor laser using reservoir computing[END_REF], we aim to predict the dynamics of the fluctuations of the laser studied in [START_REF] Ansquer | Unveiling the dynamics of optical frequency combs from phase-amplitude correlations[END_REF]. It was demonstrated that the amplitude and phase noises are mainly induced by the pump laser intensity noise. Consequently, in this section, we try to predict the power δϵ and central frequency δω c fluctuations from the intensity noise of the pump laser.

As we aim to predict the intensity related dynamics, the intensity fluctuations of the pump power are used as input data. They are measured with a photodiode from a leak in the laser cavity. The output data, used as target, are the fluctuations of each laser variable, measured using the experimental scheme described in [START_REF] Ansquer | Unveiling the dynamics of optical frequency combs from phase-amplitude correlations[END_REF]. Those quantities are recorded simultaneously. Each acquisition is composed of 10000 data points. We take 8000 data points to train the reservoir. The 2000 remaining points are used as a validation set to see how well the algorithm performs. The mean power noise and the center spectrum, predicted after training from the pump laser fluctuations to-gether with the expected signal are presented on Fig. 4. It can be seen that the experimental prediction is close to the real measured noise in both cases. Given these positive results, one could think of an active stabilization of the laser using the reservoir computing approach combined with a feedback control loop.

In conclusion we implemented an optical reservoir computing protocol exploiting the pulse basis of an optical frequency comb. The use of a homodyne detection for readout allowed us to encode the information in the phase of the coherent states. This experimental proof-of concept has a relatively small number of virtual nodes and a single hardware node that operates in a low nonlinearity regime, yet is proven to perform non-trivial computational tasks. This work paves the way toward more refined protocol with an all-optical configuration. Moreover, recent work in the squeezing generation at high repetition rate [START_REF] Kouadou | Spectrally shaped and pulseby-pulse multiplexed multimode squeezed states of light[END_REF] could be used to implement a quantum reservoir computing protocol with a scheme similar to the one of this article. The use of quantum states and the spectral multimode nature of our frequency comb could be harnessed to improve the computational capacity of our protocol as suggested in [START_REF] García-Beni | Scalable photonic platform for real-time quantum reservoir computing[END_REF].

Figure 1 .

 1 Figure 1. Experimental scheme of the delay-based reservoir computing architecture. The optical field generated by a Ti:Sa laser is separated in two. The weak beam, the signal, is sent into an electro-optic modulator (EOM) controlled by an arbitrary waveform generator (AWG). Information is encoded in the phase of each pulse by applying a voltage to the EOM. The strong beam, the local oscillator, is sent into a pulse shaper to match the dispersion introduced by the EOM on the other arm. Both beams are combined on a 50-50 beam-splitter and detected by a high bandwidth balanced detector. After low pass filtering, to control the parameter TBW , the signal is sent into a long coaxial cable to create a delay. A part of this signal is then mixed with the input data to create the feedback. The other part of the signal is acquired to proceed to the off-line training of the output weights. Optical and electronic pulses are represented in red and black, respectively.

Figure 2 .

 2 Figure 2. Experimental prediction of NARMA-2 function. The protocol was trained on 2250 input data and tested on 600.

Figure 3 .

 3 Figure 3. Pearson correlation coefficient as a function of the input delay parameter N . Experiment (solid line) and simulation (dashed line) were trained on 2250 input data and tested on 600. Black lines correspond to the experimental and numerical results for 35 virtual nodes. Increasing the number of nodes to 100 (red) reduces the error. The simulations have been performed for α = 0.7 and β = 1.0.

Figure 4 .

 4 Figure 4. Performance of the protocol on laser dynamics prediction. The input data used for the training are the fluctuations of the pump laser power. The laser power fluctuation is in red and the central frequency fluctuation in yellow.

Funding

European Research Council under the Consolidator Grant COQCOoN (Grant No. 820079) and the Agence Nationale de la Recherche with support of the Direction Générale de l'Armement (LASAGNE ANR-16-ASTR-0010-03). We acknowledge the Spanish State Research Agency, through the María de Maeztu project CEX2021-001164-M funded by the MCIN/AEI/10.13039/501100011033 and through the COQUSY project PID2022-140506NB-C21 funded by MCIN/AEI/10.13039/501100011033, MINECO through the QUANTUM SPAIN project, and EU through the RTRP -NextGenerationEU within the framework of the Digital Spain 2025 Agenda.

Disclosures

The authors declare no conflicts of interest.

Data availability

Data underlying the results presented in this paper are not publicly available at this time but may be obtained from the authors upon reasonable request.


Aurélien Benoit

Christophe Escriba

David Gauchard

Alain Estève

Carole Rossi

Christophe Aur Élien Benoit

David Escriba

Alain Gauchard

Carole Esteve

Rossi

Analyzing and Comparing Deep Learning

Keywords: Deep Learning, Energy consumption, pre-impact fall detection, Tensorflow lite, threshold-based, wearable systems

come   L'archive ouverte pluridisciplinaire

I. INTRODUCTION

O VER the past century, the average life expectancy has increased dramatically. As a result, the safety of the elderly has become a major societal concern. In particular, the increased risk of falls is one such distinct health risk factor. Unintentional falls are the leading cause of fatal injuries and the most common cause of nonfatal trauma-related hospital admissions among adults over 65 years-old [1]. Between 2015 and 2050, the proportion of the world's population aged over 60 will almost double, from 12% to 22%. Each year, approximately 684,000 people die as a result of a fall and 37.3 million of falls are recorded that are severe enough to require medical attention. In the United States of America, elderly falls costed $50 billion in 2015, and $43 billion by the year 2020. Every year in France, falls among the elderly result in over 130,000 hospitalizations and 10,000 deaths. The cost of falls among the elderly is currently estimated at 2 billion euros, including 1.5 billion for the french health insurance system. The authors are with the Laboratory for Analysis and Architecture of Systems (LAAS-CNRS), University of Toulouse, 31077 Toulouse, France (e-mail: abenoit@laas.fr; rossi@laas.fr; cescriba@laas.fr; aesteve@laas.fr; gauchard@laas.fr).

Digital Object Identifier xx.xxxxx/JSEN.xxxx.xxxxxxx

In this context, wearable sensors, such as 3D accelerometers, that can monitor daily activities, quickly identify occurring falls and send out remote notifications, are crucial to elderly care, allowing for earlier assistance. One major hurdle to the deployment of wearable sensors on elderly is the accuracy of pre-impact fall detection system, often generating false alarms,i.e., alerting fall during activities of daily living (ADL). Thus, most of recent researches have focused on reducing false alarms and improving accuracy of the preimpact fall detection system [START_REF] Kolobe | A Review on Fall Detection in Smart Home for Elderly and Disabled People[END_REF]- [START_REF] Yu | A comprehensive comparison of accuracy and practicality of different types of algorithms for pre-impact fall detection using both young and old adults[END_REF] using either thresholdbased algorithm [START_REF] Ferreira De Sousa | Wearable Pre-Impact Fall Detection System Based on 3D Accelerometer and Subject's Height[END_REF]- [START_REF] Shan | A wearable pre-impact fall detector using feature selection and support vector machine[END_REF], conventional machine learning (ML) [START_REF] Xie | ART: Adaptive and Realtime Fall Detection Using COTS Smart Watch[END_REF], [START_REF] Putra | An event-triggered machine learning approach for accelerometer-based fall detection[END_REF], or deep learning approaches [START_REF] Hnoohom | Pre-Impact and Impact Fall Detection Based on a Multimodal Sensor Using a Deep Residual Network[END_REF]- [START_REF] Koo | Tinyfallnet: A lightweight pre-impact fall detection model[END_REF]. Thresholdbased algorithms have demonstrated good performances to distinguish pre-impact falls from ADL: sensitivities are in the range of 92% -99%, specificities are in the range of 95% -98% with an average lead time (time interval between fall detection and body-ground impact occurrences) in the range of 250 -400 ms. Two interesting papers present exceptional results with a sensitivity and specificity > 97% [START_REF] Jung | Enhanced algorithm for the detection of preimpact fall for wearable airbags[END_REF], [START_REF] Shan | A wearable pre-impact fall detector using feature selection and support vector machine[END_REF] but the algorithms were evaluated on a very small sample of people. Despite the good sensitivity and specificity, thresholdbased algorithms lack of generalizability and robustness when applied to real scenarios or different groups of persons. Conventional ML algorithms such as support vector machine (SVM) were explored to detect falls using, as inputs, highly correlated parameters among raw signals of acceleration and angular velocity. Detection sensitivity > 95% and specificity > 90% with a lead time ranging from 63 to 200 ms were demonstrated. For example, Xie et al. [START_REF] Xie | ART: Adaptive and Realtime Fall Detection Using COTS Smart Watch[END_REF] used a smartwatch using the SVM method and demonstrated 100%, 95.5% and 95.7% forward, backward and lateral fall accuracy, respectively, with an average processing time of 276 ms, which is still too long to envisage a real application for pre-impact fall detection.

More recently, as computing power in hardware, especially GPUs, has advanced rapidly, deep learning-based algorithms such as Convolutional Neural Networks (CNN), Adaboost, and Long Short-Term Memory (LSTM) have been explored for pre-impact fall detection [START_REF] Hnoohom | Pre-Impact and Impact Fall Detection Based on a Multimodal Sensor Using a Deep Residual Network[END_REF]- [START_REF] Koo | Tinyfallnet: A lightweight pre-impact fall detection model[END_REF]. The significant advantage of these deep learning approaches is their ability to process raw data directly from wearable sensors and automatically extract high-level motion features through specifically designed network layers.

However, it is important to note that while these works have evaluated their model performances on computers, there is a gap in the literature concerning the assessment of deep learning models, including Recurrent Neural Networks (RNN), LSTM, CNN, and CNN-LSTM, on microcontrollers. It is worth mentioning that there are instances in the literature where deep learning models have been successfully implemented on low-power microcontrollers for various applications, such as spoken keyword spotting [START_REF] Zhang | Hello edge: Keyword spotting on microcontrollers[END_REF], human activity recognition [START_REF] Novac | Quantization and deployment of deep neural networks on microcontrollers[END_REF], [START_REF] Coelho | A lightweight framework for human activity recognition on wearable devices[END_REF], gesture recognition [START_REF] Hughes | Recognizing social touch gestures using recurrent and convolutional neural networks[END_REF], acoustic event detection [START_REF] Cerutti | Compact recurrent neural networks for acoustic event detection on low-energy low-complexity platforms[END_REF], post-stroke assistance and rehabilitation [START_REF] Jacob | Artificial muscle intelligence system with deep learning for post-stroke assistance and rehabilitation[END_REF], flow analysis in public spaces [START_REF] Xie | Efficient deep learning models for privacy-preserving people counting on low-resolution infrared arrays[END_REF], nutrition monitoring [START_REF] Sundaravadivel | Smart-log: A deep-learning based automated nutrition monitoring system in the iot[END_REF], sports activities classification [START_REF] Hsu | Wearable sport activity classification based on deep convolutional neural network[END_REF], and even for industrial applications [START_REF] Albanese | Tiny machine learning for high accuracy product quality inspection[END_REF], [START_REF] Rosero-Montalvo | Time-series forecasting to fill missing data in iot sensor data[END_REF]. The performance of these models, in terms of power consumption, accuracy, precision, and sensitivity, varies based on the specific models and problems they address.

This comprehensive review of existing research highlights the absence of studies developing pre-impact fall detection systems using deep-learning models integrated into microcontrollers for elderly care. Notably, the work by Yu et al. [START_REF] Yu | A comprehensive comparison of accuracy and practicality of different types of algorithms for pre-impact fall detection using both young and old adults[END_REF] is the only one that employs an embedded micro-computer (Raspberry Pi 4) to measure lead time and computation latency on a test set.

This paper aims to fill this gap by conducting a thorough comparison of nine deep learning models (Dense, CNN, LSTM, GRU, BiLSTM, BiGRU, CNN Dense, CNN LSTM, CNN GRU) integrated into an ultra-low-power ARM Cortex M4 microcontroller. The evaluation focuses on quantifying the models' performances for pre-impact fall detection using raw data collected from a 3-axis accelerometer. Additionally, inference time and energy consumption are measured for each model integrated into the microcontroller. As a preliminary step to the present investigation, a comparison of optimizers was performed, although the details are not covered in this paper. The major contributions of this research include:

• the first comprehensive comparison of different algorithms for pre-impact fall detection based on a large-scale motion dataset from nine young subjects, encompassing three types of ADL and four types of falls. The comparison extends beyond commonly used accuracy-related measures (e.g., accuracy, sensitivity, and specificity) to include model storage size, inference time, and energy consumption-crucial parameters in designing an ondemand fall injury prevention system for the elderly. • Pioneering research in determining which algorithms can effectively run on a microcontroller to detect pre-impact fall situations, while also assessing the current limitations of deep learning techniques for pre-impact fall detection due to their high energy consumption efficiency. This study offers valuable insights for researchers, shedding light on the strengths and limitations of each machine learning method. It also outlines pathways for integrating these methods into autonomous systems, representing a significant step towards the design of future products to address societal needs.

II. MATERIALS AND METHODS

A. Data collection and preprocessing

We used recently established Kfall public fall databases [START_REF] Yu | A large-scale open motion dataset (kfall) and benchmark algorithms for detecting pre-impact fall of the elderly using wearable inertial sensors[END_REF] for the evaluation of the different models. The Kfall dataset was collected from 32 healthy young males (age: 24.9 ± 3.7 years; height: 174.0 ± 6.3 cm; weight: 69.3 ± 9.5 kg) using a 9-axis inertial sensor attached to the lower back of each subject and sampled at 100 Hz. The dataset also includes 21 Activities of Daily Living (ADLs) and 15 simulated falls. Only the three axes of the inertial sensor were utilized in this study. Furthermore, since the Kfalls series is better suited for post-fall detection rather than pre-impact fall detection, we augmented the model training process by incorporating a custom-made dataset from nine volunteers (2 females, 7 males) in good health and without any physical conditions (average height 174.11±6.98 cm; average weight 63.57±7.91 kg). They were equipped with a circuit placed on a belt (Figure 1). Data were recorded using a specific circuitry integrating an nRF52832 System-on-Chip (SoC) from Nordic Semiconductor and a 3axis accelerometer LIS3DH from STMicroelectronics at 100 Hz. The system description can be found in [START_REF] Ferreira De Sousa | Wearable Pre-Impact Fall Detection System Based on 3D Accelerometer and Subject's Height[END_REF]. We recorded four types of falls, namely forward, backward, lateral right and lateral left, and three ADL, i.e. walking, sitting, picking up an object. Overall, this corresponds to a total of 474 acquisitions, including 188 series of ADL and 286 series of falls (a forward fall signature is plotted in Figure 2). Then, the dataset is divided into test and train sets. The train set includes 80% of the overall dataset (7 volunteers randomly chosen) while the remaining 20% of the dataset (2 volunteers) are devoted to the test set. As a result, the train set is composed of 364 series (140 ADL and 218 falls), and the test set is composed of 110 series (48 ADL and 68 falls). A "tag connect" plug was integrated to reduce the hardware footprint and programmed by Serial Wire Debug (SWD). The entire software project was built with Segger Embbeded Studio. Our system used a 512 kB FLASH and a 64 kB RAM. Note that the addition of the NORDIC and TFLM libraries occupies 29.8 kB and 181.4 kB of RAM and FLASH memories, respectively. Table I summarizes the characteristics of the accelerometers used to build the two different databases (Kfall and ours).

Then, the collected data from both custom-made and Kfall datasets were pre-processed following 2 steps. Step 1. Definition of the length of time series First, all data from the dataset were concatenated into a single row in a parquet file. Each data point within each series was labeled based on the type of movement (fall or ADL). Each file contains 8 columns, consisting of: The tiltAngle (in rad) is calculated using Equation 1 [START_REF] Ferreira De Sousa | Wearable Pre-Impact Fall Detection System Based on 3D Accelerometer and Subject's Height[END_REF] :

tiltAngle = cos -1   a y (t) a 2 x (t) + a 2 y (t) + a 2 z (t)   (1)
From each data file, we divided the overall dataset into equal frames corresponding to 25 acquisition steps, with an overlap of one acquisition step considered between two adjacent frames (referred to as a "sliding window"). This multi-frame approach has been found to enhance the performance of the ML models, reducing the amount of data treated as input for each layer of the models and capturing time variations in features. The input dataset was structured with 3 columns (sample, time-steps, features), where each input sample contains 5 features (a x , a y , a z , SVM, tiltAngle) composed of 25 values each.

Moreover, automated extraction of temporal features from various types of fall data collected using wearable sensors has been demonstrated in previous studies [START_REF] Jain | Deep ensemble learning approach for lower extremity activities recognition using wearable sensors[END_REF]. Finally, since the objective is to classify whether a fall occurred or not, each series is labeled as either "ADL" or "fall" based on the labels that occur most frequently. It is important to note that this labeling may differ from the label of some individual data points, as there are series labeled as "ADL" containing points labeled as "fall" and vice versa. These cases mostly occur at the end of each acquisition series.

Step 2. Normalization Normalization corresponds to the process of transforming data of different scales to a common scale, typically within the range [0, 1]. This is done to balance the impact of each feature on the model and expedite model convergence [START_REF] Bhanja | Impact of Data Normalization on Deep Neural Network for Time Series Forecasting[END_REF] [50]. For each feature x i , the normalization involves subtracting the median value x med and dividing it by the interquartile range (Q 75 -Q 25 ). The normalized value X is obtained using the equation 2 :

X = x i -x med Q 75 -Q 25 (2)
We opted for the Robust Scaler normalization method following a comparison with both the Standard Scaler and MinMax Scaler methods (Figure 3). The Robust Scaler is considered the most appropriate for large and wide datasets, as it effectively handles outliers that could significantly impact predictions. Unlike the Standard Scaler, which transforms data to have a mean of 0 and a standard deviation of 1 (suitable for normally distributed data), and the MinMax Scaler, which scales data to a specified range typically between 0 and 1 (preserving the original data's relationships), the Robust Scaler provides robustness against outliers.

The plots in Figure 3 illustrate the data distribution before and after the normalization step. Prior to normalization, raw data are within a small range of values [-2.5, 2.5], but they are not centered around 0, and each feature has a different disparity of values. MinMax scaling spreads the features over the range [0, 1]. Acceleration components on the x, y, and z axes are centered around 0.5, SVM around 0.1, and tilt angle is spread across the range with two density peaks at 0.5 and 0.95. With standardization, data are scaled with a mean value of 0, and density peaks are present in the [-5, 5] range. By removing the median and spreading the features over the interquartile range (IQR), features are centered around 0 with density peaks in the [-5, 5] range. It's observed that Standard Scaler and Robust Scaler have data at equivalent density scales: [0, 2]. However, Robust Scaler spreads certain features, providing a more balanced representation with uniformly distributed density peaks. In conclusion, Robust Scaler is the most suitable normalization method for the specific problem of pre-impact fall detection, as it balances the representation and facilitates effective model learning.

B. Models construction, optimization and training

In this study, nine ML models were evaluated, namely Dense, CNN, LSTM, GRU, BiLSTM, BiGRU, CNN Dense, CNN LSTM, CNN GRU, that were trained and run using Tensorflow 2.10.

Dense model was chosen as it is the base layer characterized by interlayer connections between adjacent layers and performing linear transformations on input data for the next layer, mainly for the output layer. The CNN model [START_REF] Hubel | Receptive fields, binocular interaction and functional architecture in the cat's visual cortex[END_REF], [START_REF] Fukushima | Neocognitron: A self-organizing neural network model for a mechanism of pattern recognition unaffected by shift in position[END_REF] is commonly used for computer vision tasks such as object detection, image segmentation, video recognition [START_REF] Alzubaidi | Review of deep learning: concepts, CNN architectures, challenges, applications, future directions[END_REF] or optimization energy consumption for embedded systems [START_REF] Sanchez-Flores | A review of CNN accelerators for embedded systems based on RISC-V[END_REF]. The LSTM model is suitable to classification and prediction of future values based on time series data in anomaly detection, stock prediction or gesture classification [START_REF] Van Houdt | A review on the long short-term memory model[END_REF]. Hybrid models combining Convolutional Neural Networks (CNNs) with Recurrent Neural Networks (RNNs) such as Long Short-Term Memory (LSTM) [START_REF] Hochreiter | Long Short-Term Memory[END_REF], [START_REF] Chung | Empirical evaluation of gated recurrent neural networks on sequence modeling[END_REF] or Gated Recurrent Unit (GRU) layers have been widely used in various image and natural language processing tasks [START_REF] Bi | A gated recurrent units (gru)-based model for early detection of soybean sudden death syndrome through time-series satellite imagery[END_REF]- [START_REF] Nfissi | CNN-n-GRU: end-to-end speech emotion recognition from raw waveform signal using CNNs and gated recurrent unit networks[END_REF], including speech emotion recognition and movie sentiment analysis. These models leverage the strengths of both CNNs and RNNs to capture spatial features through convolutional layers and temporal dependencies through recurrent layers. The forward and backward LSTMs are trained separately, but their outputs are combined to produce the final prediction. The output at each time step is obtained by concatenating the forward and backward hidden states, allowing the network to capture both past and future context. Bidirectional GRU (BiGRU) does exactly the same, but employing forward and backward GRU's [START_REF] Schuster | Bidirectional recurrent neural networks[END_REF].

1) Choice of the optimizers: the choice of optimizers plays a crucial role in the training process, and evaluating multiple optimizers is a good practice. We used a Bayesian optimization strategy to explore the hyperparameter space and find the optimal configuration for our hybrid model. 7 optimizers were evaluated : Stochastic Gradient Descent (SGD) [START_REF] Robbins | A Stochastic Approximation Method[END_REF], AdAptive Gradient (AdaGrad) [START_REF] Duchi | Adaptive Subgradient Methods for Online Learning and Stochastic Optimization[END_REF], Root Mean Square Propagation (RMSProp) [START_REF] Reckons | Lecture 6.5 -Rmsprop: normalize the gradient[END_REF], AdAptive Gradient Delta (AdaDelta) [START_REF] Zeiler | ADADELTA: An Adaptive Learning Rate Method[END_REF], AdAptive Moment estimation (Adam) [START_REF] Kingma | Adam: A Method for Stochastic Optimization[END_REF], Nesterov AdAptive Moment estimation (Nadam) [START_REF] Dozat | Incorporating Nesterov Momentum into Adam[END_REF], AdAptive Moment Weight (AdamW) [START_REF] Loshchilov | Decoupled Weight Decay Regularization[END_REF]. The optimal choices for pre-impact fall detection application were found to be Adam, Nadam, and AdamW optimizers. Among these, Adam emerged as the most suitable choice due to its integration of momentum, facilitating accelerated convergence, and RMSProp, contributing to the normalization of learning rates. These characteristics make Adam particularly well-suited for addressing the challenges inherent in temporal binary classification problems, where features exhibit variations over time, often characterized by sparse or non-uniform behaviors [START_REF] Hnoohom | Pre-Impact and Impact Fall Detection Based on a Multimodal Sensor Using a Deep Residual Network[END_REF], [START_REF] Jain | Deep ensemble learning approach for lower extremity activities recognition using wearable sensors[END_REF], [START_REF] Kim | Acceleration Magnitude at Impact Following Loss of Balance Can Be Estimated Using Deep Learning Model[END_REF], [START_REF] Shi | Pre-Impact Fall Detection with CNN-Based Class Activation Mapping Method[END_REF], [START_REF] Yadav | ARFDNet: An efficient activity recognition & fall detection system using latent feature pooling[END_REF]- [START_REF] Musci | Online Fall Detection Using Recurrent Neural Networks on Smart Wearable Devices[END_REF]. The adaptability of Adam to capture temporal dynamics aligns seamlessly with the nature of our application, enhancing the effectiveness of our hybrid model in detecting falls prior to impact.

2) Kernel initializer, Activation functions and hyperparameters tuning: According to [START_REF] Geron | Hands-on machine learning with scikit-learn, keras, and TensorFlow: Concepts, tools, and techniques to build intelligent systems[END_REF], the activation functions Relu and Leaky Relu must be initialized with He. Although ReLU is widely used due to its simplicity and efficiency, it provides zero activation for negative values. This leads to the phenomenon called "dead neurons" or "dying ReLU" as negative neurons do not contribute to learning. To avoid this problem, the Leaky ReLU activation function is used to assign a slope of 0.1 to negative neurons. Hence, when a activation is negative, neurons fall into a "sleep" state but continue to receive gradient updates. 3) Hyperparameters: Hyperparameters summary is presented in the Table III and final models are presented in the Tables IV and V. Each of them was trained on 200 epochs with Adam optimizer and batch size of 128. Binary cross-entropy was used. In the case of no improvement in the validation loss after 10 epochs, we used a call to stop the training process. GPU-accelerated library, were used. This study was achieved under the Windows 10 as OS environment, using Intel Core i9-12950HX as CPU and 64Go 4800MHz DDR5 as RAM. The experiment was programmed using Python v3.10.10, Tensorflow 2.10 and CUDA v11.2.152 graphic cards.

5) Porting models into ARM 32 bit Microcontroller: All models with parameters outlined in the provided Table II, underwent reduction procedures as detailed in [START_REF] Novac | Quantization and Deployment of Deep Neural Networks on Microcontrollers[END_REF]. Subsequently, these optimized models were implemented on the microcontroller using the TensorFlow Lite for Microcontrollers (TFLite Micro) library. This implementation involved leveraging configuration optimizations to enhance efficiency and streamline the deployment process. Procedure is :

• TARGET=cortex m generic : selects the target microcontroller family. • TARGET ARCH=cortex-m4+fp : enables support for hardware floating point on cortex-m4. • OPTIMIZED KERNEL DIR=cmsis nn : enables the use of the CMSIS-NN library optimizations for performance boost on ARM Cortex core microcontrollers. Reduction or quantization is the process of converting the weights and activations of a neural network from high-precision floating-point numbers to lower-precision representations, resulting in lighter models. This process is crucial for deploying deep learning models on resourceconstrained embedded systems, such as our system. Prior to quantization, the models utilize 32-bit floating-point numbers (float32) for representing weights and activations, ensuring high precision. We conducted tests on three quantification techniques-Optimized Integral type with floating fold, Float16 Quantization, and Float8 Quantization. For each model, we selected the quantization method that produced the lightest model. Specifically, Float8 Quantization was employed for Dense, CNN, BiLSTM, CNN DENSE, CNN LSTM, and CNN GRU models. For LSTM, GRU, BiGRU, the Optimized Integral type with floating fold method was chosen.

The memory size before and after quantization is reported in the Table VI. We observed that the float8 models experience size reduction without introducing any additional operators. In contrast, integer models include two extra operators, namely "Quantize" and "Dequantize." The architectures of float16 models exhibit the highest complexity. In the case of CNNs, multiple "Dequantize" operators are integrated as inputs to the "Conv2D" operators, and a similar pattern is observed for FullyConnected operators in DENSE models. For recurrent models featuring LSTM and GRU layers, the LSTM and GRU operators are transformed into numerous elementary operators, accompanied by the inclusion of "while" operators, each containing over twenty operators. Additionally, "Dequantize" and "Quantize" operators have been incorporated. The necessity for including Tensorflow operators, in addition to Tensorflow Lite operators, arises during quantization to float. Importantly, the use of signatures before conversion becomes impractical in this scenario. Throughout the remainder of the paper, our focus is exclusively on quantized models, denoting reduced models. The programming languages employed were C and C++. The nRF5 v17.1.0 Software Development Kit (SDK) facilitated Bluetooth low energy and 2.4 GHz support compatibility.

For the nRF52832 System-on-Chip (SoC), the SoftDevice version employed was v7.2.0, and the Segger Embedded Studio version used was v7.10a. Notably, BiLSTM models were not implemented on ARM microcontrollers using TFlite Micro due to the lack of support for the "REVERSE V2" operation, essential for inverting data windows before the "UNIDIRECTIONAL SEQUENCE LSTM" operation. To overcome this limitation, we developed a custom "REVERSE V2" operator for Tensorflow Lite for microcontrollers. The implementation underwent rigorous unit testing to ensure its functionality, using Bazel v6.2.0. To maintain consistent code formatting in Google style, clang-format v16.0.4 was applied. After completing the tests, the entire library was recompiled. Two key metrics guided our testing process: functional coverage and linear coverage. Functional coverage was employed to verify that all functions were adequately covered, ensuring their correct implementation. Linear coverage, on the other hand, focused on source code coverage, measuring the execution of specific lines of code during the tests. This metric provided insights into the portions of the source code that were executed at least once during testing. Hence, we designed a set of six unit tests, encompassing 2 tests for each compatible input and output type-float32, int8, and int16. For each data type, one test involved a 1D tensor, while the other utilized a 3D tensor. Through these tests, we achieved comprehensive functional coverage, ensuring that all functions were systematically covered. Additionally, our testing process resulted in a commendable linear coverage of 83.9%, signifying the extent to which specific lines of source code were executed during the testing phase 6) Threshold method in post processing: Upon detecting false alarms in the ADL series concerning pre-impact fall detection, we identified a noteworthy correlation between the variance of the sum of acceleration vectors (SVM) after normalization and actual fall events. In response to this observation, we introduced a filtering condition aimed at mitigating false alarms. This condition involves verifying whether the variance of the classification window surpasses a threshold of 2 (after normalization), equivalent to 1.156713 g. The normalization conversion for raw accelerometer data is represented by Equation 3.:

X norm = x i -cv sv (3)
with X norm normalize value, x i , raw value, cv, center value of 0.9622855 and scaler value of value 0.09721375. This is a filtering post-processing step. After each window prediction, the SVM variance (Equation 4) is calculated and, if it exceeds the threshold, we consider that a fall is starting.

variance = N i=1 (x i -µ) 2 N ( 4
)
with µ, the mean value of the ensemble of the data from one window.

It's important to highlight that the chosen threshold value not only enhances the sensitivity, accuracy, and specificity of pre-fall detection (metrics defined in the next section) but also influences the lead time. The optimal threshold value was identified as 2, ensuring a lead time greater than 100 ms. This time window allows sufficient duration for triggering the inflation of an airbag before making contact with the ground. It's noteworthy that the same threshold is consistently applied across all models for the sake of comparison. This approach aligns with the methodology used by Shi et al. in their work on pre-impact fall detection [START_REF] Shi | Pre-Impact Fall Detection with CNN-Based Class Activation Mapping Method[END_REF], where a post-processing threshold was also incorporated.

III. RESULTS AND DISCUSSION

In the following we consider some important outputs as basis for the analysis: True Positives (TP), which correspond to correctly classified falls before impact, True Negatives (TN), which correspond to correctly classified ADLs, False Positives (FP), which correspond to misclassified falls in ADLs and False Negatives (FN), which correspond to misclassified ADLs in falls. From these outputs, we calculate three metrics:

• Sensitivity (SEN) defined as the ratio of the number of correctly classified falls out of the total number of falls, calculated as : SEN = T P T P + F N This metrics informs if the fall is correctly detected.

• Specificity (SPE) defined as the ratio of the number of correctly classified adls out of the total number of adls.

SP E =

T N T N + F P Which quantifies the ability of the model to correctly distinguish ADLs from falls.

• Accuracy (ACC) defined as the ratio of the number of correct predictions out of the total number of samples :

ACC = T P + T N T P + T N + F P + F N
This metric quantifies the model ability to correctly identify real falls and ADL • F1-score defined as the harmonic mean of precision and sensitivity. It compares the correct positive predictions T P with the errors (F N + F P ) of the model.

F 1 -score = T P T P + 0.5(F P + F N )

A high F1-score signifies the effectiveness of the experimental method. The memory sizes associated with the various models are also provided in kilobytes (kB). We also assessed the inference time and number of CPU cycles for the models running on both the computer and the microcontroller (refer to Table VIII). The runtimes can be categorized into three groups: Dense, CNN models exhibit the most optimal performances with 0.138 ms, 0.713 ms, respectively, on the computer. Upon adding a dense layer, the CNN's runtime extends to 0.723 ms. However, BiLSTM performs 100 times slower on the microcontroller than on the In summary, among all tested models, the CNN emerges as the top performer for pre-impact fall detection, boasting an average lead time of 176.91 ms and a detection accuracy of 94.70%. This outcome is unsurprising given the inherent strengths of the CNN model in processing intricate and extended temporal sequences. By automatically extracting hierarchical patterns at various scales from temporal sequences, the model adeptly captures both short-and long-term features, facilitated by the utilization of convolution filters of different sizes. Secondly, the architecture employs weight sharing among convolution filters, allowing the learning of valuable features irrespective of their exact position in the temporal sequence. Moreover, the convolution operations incorporate temporal translation invariance, enabling the CNN to identify patterns without dependence on their specific temporal location. This feature is particularly crucial for pre-impact fall detection.

Importantly, falls exhibit variations in terms of their duration and acceleration signal from one instance to another. Notably, CNN models are distinguished by matrix and convolution operations that are parallelized and optimized for ARM architectures. The utilization of convolution effectively reduces the size of tensors as data propagates through the network. The commendable performance of CNN is coupled with a low memory cost (39.352 kB) and minimal electrical consumption (averaging 6.53 mA). By augmenting the CNN model with an increased number of convolution filters and the addition of a Dense layer, we obtain a CNN DENSE model with 94.70% accuracy, 95.33% sensitivity, and 94.18% specificity. The heightened complexity of the model results in an inference time of 12.878 ms and leads to a slight increase in power consumption (6.72 mA compared to 6.53 mA).

The Dense model stands out as the fastest, achieving an inference time reduced to 2.188 ms, and demonstrating a relatively good detection accuracy of 85.96% and sensitivity of 93.40%. However, the specificity is not as favorable, registering at only 77.57%. This could be attributed to the complexity of the temporal features utilized. The underlying cause might be a class imbalance issue, where there is a larger number of fall series compared to that of ADLs. In scenarios with such an imbalance, higher specificity tends to come at the expense of lower sensitivity. To address this concern, training took into account the class imbalance by defining an initial bias for the output layer using the equation: bias = log(fall's number/adl's number). The reason behind the lower specificity in Dense models is their consideration of each data point independently, making it challenging to correctly identify the temporal and spatial dependencies present in the time series. The favorable inference time is attributed to the utilization of an interconnected linear neuron with the equation y = W x + b where y is the output, W is the weight matrix, x is the input and b is the bias vector. Additionally, the use of weight matrices is instrumental in conserving memory space and minimizing data transfer between the memory and the microprocessor.

Certain models clearly exhibit underperformance, notably BiLSTM, LSTM, GRU, BiGRU, CNN LSTM, and CNN GRU in terms of pre-impact fall detection accuracy, specificity, and inference time. BiLSTM achieves commendable performance for pre-impact fall detection with an average lead time of 121.16 ms and a detection accuracy of 86.90%. However, due to their capability to store long-term information, BiLSTM models can be sensitive to subtle variations in the data. In the context of fall detection, this sensitivity may result in normal fluctuations or noise being considered, impacting overall performance. Additionally, the inferior performance of BiLSTM comes at the expense of high memory cost (531.664 kB) and elevated electrical consumption (average of 7.88 mA). Ye and Yu [START_REF] Ye | Fall detection system based on BiLSTM neural network[END_REF] also reported the good performances of BiLSLM model (Table X) to detect a fall (accuracy 90.47%) using data from an IMU and pressure sensors. But the authors did not mention about the sampling frequency.Among them, GRU and LSTM emerge as the least effective performers, achieving accuracies of 76.22% and 74.49%, respectively. During the conversion of the GRU model to the tflite format, the GRU layer transforms into 10 basic operators, including 2 flex operators. This transformation is a consequence of employing Tensorflow Lite's Flex delegate to optimize the execution of floating-point operations. However, it's worth noting that the Flex delegate is currently incompatible with TFLite Micro for direct integration into a microcontroller. Following quantization, the basic operators are replaced by a "While" operator, as the GRU layer is not directly portable to microcontrollers. This process involves defining the expected input data format for the model (Figure 4). Tensorflow's quantization tool then converts and adapts the required operators for the model. Given that the GRU model entails recurrent calculations performed on each element of an input sequence, the "While" operator efficiently and flexibly handles dynamic variations in sequence lengths.

B. Time complexity analysis

To gain insights into the respective inference times of the models, we conducted an algorithmic analysis on their time complexity. Time complexity quantifies the number of basic operations, such as multiplications and summations, performed by the model, expressed as a function of the input size nn (refer to Table IX for the big notation expressions of time complexity). Analyzing time complexity is a more rigorous approach than measuring inference time for model benchmarking, as the latter is susceptible to various parameters, including the hardware platform, compiler optimization, and the APIs utilized for model implementation.

DENSE Θ na 1 + a 4 k + 4-1 i=1 a i a i+1 CNN O( 2 i=1 f i-1 s 2 i f i m 2 i ) + DC LSTM O( 3 i=1 4h i (d i + 3 + h i ) + DC GRU O(3h(d + 2 + 3h)) + DC BiLSTM O( 2 i=1 4h i (d i + 3 + h i ) + DC BiGRU O( 3 i=1 3h i (d i + 2 + 3h i ) + DC CNN DENSE O(ns 2 f m 2 ) + Θ (na 1 + a 1 a 2 + a 2 k) CNN LSTM O(( 2 i=1 f i-1 s 2 i f i m 2 i ) + 4h(d + 3 + h)) + DC CNN GRU O(( 2 i=1 f i-1 s 2 i f i m 2 i ) + 3h(d + 2 + 3h
)) + DC DENSE : n -inputs, a -hidden neurons, k -output neurons, CNN : f -filters, m -size output feature map, s -size filter LSTM / GRU : d -entries lenght of sequence, h -hidden cell Θ -strict bound , O -upper bound DC :Θ (na 1 + a 1 k)

According to He et Sun [START_REF] He | Convolutional neural networks at constrained time cost[END_REF], the time complexity of convolution layers is estimated by O(

d i=1 f i-1 s 2 i f i m 2 i )
, where d is the number of convolutional layers, f i is the number of filters in the i th layer, f i-1 is the number of input channels of the ith layer, s i is the spatial size of the filter, and m i is the spatial size of the output feature map. From equations given in Table IX, we observe that different parameters and features influence the inference time: in the LSTM and GRU models, the time complexity depends mainly on the number of hidden cells (h) and the length of the input sequences (d). The time complexity of the Dense model depends on the number of hidden neurons (a) and the number of output neurons (k). Hybrid models (CNN DENSE, CNN LSTM and CNN GRU), which combines different architectures, combine different complexity terms for the different parts of the convolution and recurrence architectures. The Dense model has the shortest inference time of all considered models, simply because it is the simplest, restricted to basic operations such as matrix multiplication and direct addition. The integration of TensorFlow Lite for Microcontrollers on the microcontroller improves inference on ARM microcontrollers.

The table in Appendix I (Table XII) details the number of operations executed by the machine. Models incorporating FullyConnected and/or convolution layers are well-integrated, benefiting from their low number of operators and the optimization of matrix multiplication for modern architectures. Additionally, convolution layers use shared filters to identify patterns in input data, reducing the overall number of parameters.

Recursive models such as LSTM, while employing a small number of operators, are computationally intensive. LSTM necessitates significant computational repetition for each time step in the sequence and is not optimized for 32-bit architec-

C. Comparison with the literature

Table X presents different pre-detection and falls detection models as a function of ACC, SEN, SPE and lead time. Compared with studies utilizing data sampled at 100 Hz, our performance stands out with superior accuracy. In a study by Mekruksavanich et al. [START_REF] Mekruksavanich | The Effect of Sensor Placement for Accurate Fall Detection based on Deep Learning Model[END_REF] on the Kfall dataset, CNN, LSTM, and CNN LSTM models were tested for fall detection, yielding accuracies of 85.69%, 90.12%, and 84.04%, respectively.

Another study by Hnoohom et al. [START_REF] Hnoohom | Pre-Impact and Impact Fall Detection Based on a Multimodal Sensor Using a Deep Residual Network[END_REF] achieved improved detection accuracy (91.87%) by implementing a multi-kernel CNN model, FDSNeXt, on the Kfall dataset. However, at our sampling frequency of 100 Hz, our simple CNN DENSE model outperforms highly complex models such as FDSNeXt, showcasing better accuracy.

Nevertheless, at lower sampling frequencies, multi-kernel CNN models demonstrate superior performance compared to ours. For instance, Wang et al. [START_REF] Wang | Pre-Impact Fall Detection Based on Multi-Source CNN Ensemble[END_REF] achieved 98.6% accuracy by incorporating pressure sensors (connected insoles) along with IMU data in a CNN model. Similarly, Choi et al. [START_REF] Choi | Deep Learning-Based Near-Fall Detection Algorithm for Fall Risk Monitoring System Using a Single Inertial Measurement Unit[END_REF] utilized acceleration and gyroscopic data (40 features) to attain 99% accuracy with a modified CNN model, along with a lead time of 662 ms.

When examining the Sisfall dataset with a sampling frequency of 200 Hz, CNN LSTM models surpass our work in both accuracy and lead time, as evidenced by studies conducted by [START_REF] Jain | A novel Feature extraction method for Pre-Impact Fall detection system using Deep learning and wearable sensors[END_REF]. In these investigations, the CNN model is applied to create feature maps from acceleration and gyroscopic data. Furthermore, when combined with a Dense Model (MLP -Multilayer Perceptron), an impressive accuracy of 98.4% is achieved [START_REF] Feng | A pre-impact fall detection data segmentation method based on multi-channel convolutional neural network and class activation mapping[END_REF].

Despite these models exhibiting high performance compared to our work, there is limited information available on their power consumption. Consequently, there is a need to expand our literature review to encompass fall detection models. Table XI provides an overview of various pre-detection and fall detection models, considering factors such as inference time, power consumption, and the type of hardware used. It's worth noting that the performance of CNN-LSTM in our study is relatively lower compared to its reported use in the literature. Typically, CNN-LSTM architectures consist of three convolutional blocks and two LSTM blocks. For instance, in the work by [START_REF] Yu | A comprehensive comparison of accuracy and practicality of different types of algorithms for pre-impact fall detection using both young and old adults[END_REF], this architecture achieves an impressive 99.16% accuracy, 99.32% sensitivity, and 99.01% specificity using a 50-step input window with 9 input characteristics. Similarly, [START_REF] Jain | A novel Feature extraction method for Pre-Impact Fall detection system using Deep learning and wearable sensors[END_REF] reports an accuracy of 97.52% using the same type of model with a sliding window size of 200 steps for 6 input features. But, in our study, we utilized a smaller window of 25 steps with 5 input features. The variation in accuracy may be attributed to differences in the input window size and the number of features compared to the architectures reported in the literature. Additionally, as highlighted in Table X, employing 100 Hz input data (such as Kfall) results in a reduction in the accuracy of the CNN LSTM, likely due to information loss. Conversely, as the sampling frequency increases, so does the accuracy of the model.

The utilization of a Cortex M4 significantly diminishes power consumption in comparison to a microcomputer and an FPGA. This is expected as the latter two must handle more intricate background execution tasks, leading to higher power consumption. Novac et al. [START_REF] Novac | Quantization and Deployment of Deep Neural Networks on Microcontrollers[END_REF] specifically focuses on the quantization and deployment of deep neural networks on low-power 32-bit microcontrollers. In their work, they used the UCI-HAR dataset for everyday life activity classification, which comprises data acquired at 50 Hz from a smartphone IMU [START_REF] Reyes-Ortiz | Human Activity Recognition Using Smartphones[END_REF]. The ResNet model [START_REF] He | Deep residual learning for image recognition[END_REF] they employed demonstrated lower energy consumption (4.8 mA) compared to our model, albeit with a longer inference time (119.541 ms) owing to the complexity of the architecture.

In a different context, Hammerla et al. [START_REF] Hammerla | Deep, convolutional, and recurrent models for human activity recognition using wearables[END_REF] utilized BiL-STM for human activity recognition, achieving an accuracy of

D. Summary and Paths to Improvement

We have demonstrated the implementation of machine learning models on a microcontroller within an integrated circuit. However, the accuracy of pre-impact fall detection is not currently sufficient for commercial product implementation, as false alarms remain an issue (best accuracy 95%). This is a significant barrier to social acceptability, as trust is a key factor in the acceptance and adoption of wearable technologies by the elderly, as established in previous studies [START_REF] Li | Health monitoring through wearable technologies for older adults: Smart wearables acceptance model[END_REF] [START_REF] Malwade | Mobile and wearable technologies in healthcare for the ageing population[END_REF].

Nevertheless, we anticipate that these limitations will be addressed in the near future with the availability of larger and better datasets for model training. In this study, we worked with 278 time series captured at a frequency of 100 Hz, resulting in a small sliding window size. Additionally, the dataset used here is based on the movements of a young adult and not an elderly person, as it was ethically challenging for us to create datasets of falls and activities of daily living (ADLs) involving elderly individuals for research purposes.

It's worth noting that the Sisfall dataset [START_REF] Sucerquia | SisFall: A Fall and Movement Dataset[END_REF] does exist and comprises a substantial number of simulated activities of daily living (ADLs) in elderly people, with an acquisition frequency of 200 Hz and 908 series. However, the Sisfall dataset contains relatively few data points on falls by the elderly (75 series from one volunteer). Consequently, we anticipate that the results of this study could be modified and improved with the availability of larger and more relevant datasets.

A third limitation identified in this study, which also represents a potential avenue for improvement, is the introduction of a condition based on the variance of the classification window to enhance the accuracy of fall detection models on microcontrollers (MCUs). This approach aims to reduce false alarms while maintaining high performance in detecting forward drops.

Lastly, the size of the microcontroller poses a challenge for the integration of classification models, especially since the developed system was initially intended to work with a threshold algorithm [START_REF] Ferreira De Sousa | Wearable Pre-Impact Fall Detection System Based on 3D Accelerometer and Subject's Height[END_REF]. Addressing these limitations and considering these avenues for improvement will likely contribute to the advancement of fall detection models on microcontrollers.

IV. CONCLUSION

In this paper, we assessed the integration of Deep Learning models into an ultra-low power embedded system designed for pre-impact fall detection. Using Kfall dataset, we found that the CNN DENSE model demonstrated satisfactory performances with accuracy reaching 94.70%, sensitivity 95.33% and specificity 94.18%. The average current consumption is 6.72 mA, equivalent to a power consumption of 22.17 mW, with a minimum inference time of 2.188 ms for the Dense model and a maximum of 515.194 ms for the BiGRU model. These results were compared with a comprehensive review of the state of the art, revealing a lack of data and concern about energy consumption, a critical aspect for nomadic deployment. This study has shed light on the limitations of deep learning for pre-impact fall detection, particularly in terms of energy efficiency, interpretability, and continuous learning capacity. As a promising avenue for future work, spiking neural networks (SNNs) are introduced. SNNs leverage the asynchronous functioning of the human brain, employing discrete pulses to transmit information. This bio-inspired approach offers several potential advantages, including reduced intensive computations, greater adaptability to continuous learning, and improved interpretability of models through the analysis of neuronal activations and discharge patterns. By delving into this direction, it should be possible to significantly enhance the performance of portable artificial intelligence systems, aligning them more closely with the operating principles of the human brain. A neuromorphic chip will be integrated into the system to design a new pre-impact fall detection model based on spiking neural networks.

APPENDIX I

Fig. 1 .

 1 Fig. 1. Prototype of the pre-impact fall detection circuitry

•

  Time : time step • a x , a y , a z : components of the acceleration along x, y, z axes • SVM : sum vector magnitude of the acceleration • tiltAngle : Tilt angle from the y-axis relative to the fall • user : name of volunteer • type : type of movement • Test : test number • label : class for output classification models

Fig. 2 .

 2 Fig. 2. Forward fall, time evolution of : (top) components of the acceleration along axis x, y, z and sum vector magnitude (SVM), (bottom) tilt angle

Fig. 3 .

 3 Fig. 3. Comparison of normalisation methods, namely MinMax Scaler, Standard Scaler and Robust Scaler techniques, on dataset (train and test set)

  tures. GRU, BiGRU, and CNN GRU share a common WHILE operator procedure in their TensorFlow Lite architecture. A closer examination of this procedure reveals that the operator can be decomposed into a more complex architecture based on 35 elementary operators (ADD, SPLIT, CONCATENATION, MUL, or RESHAPE, Figure5in Appendix II). Despite compacting the model as explained in section II-B.5, the GRU layer remains suboptimal for microcontrollers. Future work will involve making substantial contributions to TensorFlow operator support to ensure optimal operation on ARM systems.

Fig. 4 .

 4 Fig. 4. GRU model structure (left) before and (right) after quantization

Fig. 5 .

 5 Fig. 5. Architecture in operator WHILE from CNN GRU model

  Manuscript received xxxx xx, xxxx; revised xxxx xx, xxxx; accepted xxxxxx xx, xxxx. Date of publication November xx, xxxx; date of current version xxxxx xx, xxxx.

TABLE I CHARACTERISTICS

 I OF THE ACCELEROMETERS USED TO BUILD THE TWO DIFFERENT DATABASES (KFALL AND OURS)

	Features sensors	Kfall	Our dataset
	Sampling frequency	100 Hz	100 Hz
	Sensibility	16 g	8 g
	Resolution	16 bits	12 bits

TABLE VI DETAILS

 VI OF MEMORY SIZE REDUCTION FOR TENSORFLOW LITE MODELS (IN KILOBYTES, KB)

	Model	Dense	LSTM	GRU	CNN	BiLSTM	BiGRU	CNN DENSE CNN LSTM	CNN GRU
	Unoptimized	101.220	741.768	40.536	99.160	531.664	567.160	101.864	1011.928	409.976
	Optimized Integral type with floating fold	29.304	196.632	21.376	40.856	154.816	159.640	42.616	268.256	122.528
	Optimized 16 bits	53.368	392.276	27.256	59.576	280.496	292.768	62.776	517.512	214.060
	Optimized 8 bits	28.600	198.720	22.312	39.352	142.888	162.664	38.968	264.656	118.82
	Reduction(%)	71.74	73.20	47.26	60.31	70.88	71.31	61.74	73.84	71.01
		Figures in bold correspond to the models running on the microcontroller.

TABLE VII PERFORMANCE

 VII METRICS FOR EACH MODEL USING THE KFALL DATASET.

	Model	Dense	LSTM	GRU	CNN	BiLSTM BiGRU CNN DENSE	CNN LSTM CNN GRU
	Accuracy (%)	85.96	74.49	76.22	92.61	86.90	80.16	94.70	79.81	80.77
	Sensibility (%)	93.40	98.97	57.52	98.39	80.20	92.88	5.33	96.80	82.92
	Specificity (%)	77.57	46.42	97.25	87.18	94.41	65.62	94.18	60.52	78.35
	F1-score (%)	87.58	80.57	71.92	92.84	86.62	71.92	94.56	83.60	82.03
	Lead time mean (ms) 214.26	611.26	122.42	233.76	121.16	440.52	176.91	593.23	236.34
			Memory size microcontroller (kB) FLASH -512 kB, RAM -64kB
	FLASH	307.3	495.4	345.0	318.0	454.2	495.2	317.67	489.7	457.9
	RAM						31.5
	computer, while the convolution models are 16 and 17 times
	slower on the microcontroller. The slowest model is BiGRU
	(515.19 ms), while the fastest model is the DENSE (0.188 ms).
	It's noteworthy that the execution of the CNN GRU model on
	the microcontroller encountered failures.

TABLE X COMPARISON

 X OF PERFORMANCE METRICS FOR EACH MODEL FROM

			OPEN LITTERATURE
	Model	Dataset	ACC	SEN	SPE	Lead time
	CNN	Kfall**	94.70	95.33	94.18	176.91 ms
	DENSE
	FDSNeXt	KFall**	91.87	-	-	-
	[20]
	CNN [20]	KFall**	85.688	-	-	-
	LSTM	KFall**	90.121	-	-	-
	[20]
	CNN	KFall**	84.036	-	-	-
	LSTM
	[20]
	PreFall	Kfall**	98.05	94.79	98.53	551.3 ms
	k.d. [77]
	CNN	Sisfall*	97.52	99.24	-	500 ms
	LSTM	Kfall**
	[25]
		Sampling frequency note : * 200 Hz , ** 100 Hz
		k.d. : knowledge distillation

Aur élien BENOIT graduated from the University Institute of Technology Lyon (IUT) in 2017 with a two-year technical degree in Industrial Engineering and Maintenance (GIM), from the University Claude Bernard Lyon 1 (UCBL) in 2020 with a bachelor's degree in Electronics, Electrical Energy and Automation, and from the University Toulouse 3 Paul Sabatier (UT3) in 2022 with a master's degree in Embedded Systems and Microsystems. He is currently preparing a PhD in embedded systems at LAAS-CNRS, University of Toulouse. His research focuses on the development of new gasgenerating technologies and materials, and electronic miniaturization to design a next-generation miniaturized portable airbag. Carole ROSSI received the degree in engineering physics and the Ph.D. degree in electrical engineering and physics from the National Institute of Applied Sciences Toulouse, France, in 1994, and 1997, respectively. She is currently a Researcher with the French National Center for Scientific Research (CNRS). She is also working with the Laboratory for Analysis and Architecture of the Systems (LAAS). She is interested in the use of nanomaterials in energy applications for security applications. This includes the use of novel fuel/oxidizer assemblies for advanced pyrotechnical applications as igniters, thrusters or microactuators. She has coauthored more than 190 articles and holds six European patents. She was awarded from the European Council research in advanced grant category in 2019.

Christophe