1 Introduction

Prevention of cardiovascular diseases could contribute to reduce the increasing health care expenditures. Was been estimated that more than 5 million deaths per year are due to low level of physical activity (it could be considered a pandemic).

It is suggested a physical activity in at least 150 min of moderate-intensity activity or 75 min of intense activity per week to reduce the risk of mortality due to cardiovascular disease.

Some physiologic person’s requirements, such as the physical activity and the hydration, cannot be directly evaluated by the individuals and normally such signs are underrated by them. An automated measurement and expert system is mandatory, such as the Personalized Activity Intelligence (PAI) (Bjarne et al. 2016) algorithm, developed for the prevention of cardiovascular diseases.

Biofeedback is an holistic therapeutic practice that allows to the person to self-control his/hers physiologic responses (e.g. hydration needs) that are out of voluntary control or out of order due to a disease or a trauma. To prevent severe diseases (mainly cardiovascular diseases) a biofeedback system could enable a subject to be aware about his/hers physiologic status and to act according to the system warnings (e.g. drink an adequate quantity of water).

Several investigations demonstrated that cognitive-behavioral training with Heart Rate Variability (HRV) biofeedback would augment vagal recovery from acute stress (Moravec and McKee 2011). As patients with coronary heart disease (CHD) who experience depressed mood or psychological stress exhibit decreased vagal control of heart rate (HR), as assessed by spectral analysis of HR variability (HRV). Myocardial infarction and sudden cardiac death are independently associated with depression and stress, as well as impaired vagal heart rate (HR) control (Nolan et al. 2005).

Psychiatric disorders are associated with autonomic dys-regulations. These dys-regulations are partly responsible for the increased mortality in patients with psychiatric disorders. The determination of the heart rate variability (HRV) is a method easily applicable and allows the assessment of the autonomic control of the heart rate regulation (Stapelberg et al. 2012).

Uninvasive vital signs measurement, mainly cardio-circulatory related signs (HR and HRV) is a recent opportunity that enables application of the biofeedback methods to implement a wearable system for self-control of health in elderly and young people too.

Most important vital signs can be measured uninvasively such as (HR, HRV, ElectroDermal Activity (EDA), Blood Pressure (BP), Peripheral Oxygen Saturation (SpO2), R–R interval, inertial, temperature) thanks to recent advances of analog and mixed signal microelectronics.

A wide range of attachable devices have been developed (Peake et al. 2018), embedding state-of-art sensing technologies such as optical, inertial, thermal, chemical, mechanical, most of them based on micromachinery technology [Micro Electro Mechanical Systems (MEMS)] the integration of mechanical devices in dimension between 100 nm and 100 µm (Palhalmi and Broeders 1995). Such devices attached to the body provide measurements about body vital signs so a biofeedback process could be deployed. To this purpose the most promising of them are the watch-like and the bracelet-like devices. These have enough room to host all the required microelectronics supporting the full requirements of a wearable biofeedback application: computing power, analog front-end (AFE), mixed-signal electronics, wireless communication, nonvolatile mass storage, electric power harvesting, non-invasive wearing.

An important part of a successful biofeedback application are the computational paradigms applied to infer about the measurements for prediction and warning purposes. Such paradigms belong to two computational categories: hardcomputing and softcomputing. Hardcomputing methods, that is the algorithm-based computing, require the development of mathematical models and signal processing models (linear) for features extraction from crisp measurements. Softcomputing methods, that is the artificial intelligence-based computing, deal with fuzzy measurements and brain-inspired inference (nonlinear) models to predict and to infer from fuzzy measurements.

Due to the fuzzy nature of the vital signs measurements, the softcomputing paradigms, mostly the brain-inspired ones (Wysoski and Benuskova 2010), [e.g. Fuzzy Neural Networks (FuNNs) and Spiking Neural Networks (SNNs)], are the best fitting to the biofeedback applications.

An interesting research (Lauraitis et al. 2018) on prediction of neurological movements disorders (hand tremors and nonvoluntary movements) proposed a hybrid (neurofuzzy) model to predict the functional capacity of a person and the stage of reaction. The research explores several ANNs and a Mamdani Type-1 fuzzy logic system (FLS) into a hybrid model study. This is interesting in that it evaluate separately the two paradigms highlighting the peculiarity and performance of each one in solving specific tasks. This approach results in higher complexity and low integration level.

Three more requirements need to be accomplished in biofeedback applications: the spatio-temporal nature of the data, the evolving nature of learning from data, the on-line nature of the inference. All these requirements can be accomplished by the softcomputing paradigms, mainly those based on Evolving Connectionism Systems (ECOS) (Watts 2009).

Personalized (individualized) Modelling (PM), classification and prediction of spatio-temporal data for prediction of events, applying a novel evolving spiking neural network reservoir eSNNr was been successfully proposed and tested (Kasabov et al. 2014) for stroke prediction. Continuous value input information was encoded in spikes trains and classified in evolving mode. The system is generated every new individual, using existing data of similar individuals. Trained and optimized, the system demonstrated accurate spatio-temporal pattern recognition and early prediction capabilities of individual events.

Bioinspired softcomputing methods, such as the neuromorphing paradigms and the physiologic control models known as biofeedback are innovative. These provided the most important innovation in the field of computation (brain inspired paradigms) and in the field of medicine (translational medicine).

The BioFeedback method in medicine demonstrated high capabilities to model the interaction between the human being and his/hers physiology. Therapy and prevention could be well deployed by a biofeedback approach and the related system that implements it (Bulaj 2014). The biofeedback was been considered a bioinspired method and it was proposed (Pizzolato et al. 2017) to provide the real-time signals to guide the training and the rehabilitation.

We apply and generalize the biofeedback approach to model and deploy a wearable system to predict and recover the degenerative diseases providing to the person the capability to self-control the daily health. Last generation’s softcomputing paradigms such as EFuNN and ESNN embeds peculiarities like online evolution and online learning that best fit the requirements of a wearable biofeedback system. It is a first step towards a new model of interaction between man and machine. This is the novelity of our approach. It puts together the state of the art of the off-the-shelf (OTS) wearable and sensing technology with the last successful brain inspired ANN paradigms. The novelty is due also to the translational approach to medicine (Dai and Chan 2013) that bases on multiple expertise integration (engineer, scientists and clinicians) that results in diagnostic devices, powerful algorithms, business enterprise that answer to complex medical issues.

The novelty of our biofeedback system stay in its general purpose applicability. It works like an intelligent black-box that logs continuously the vital signs and executes predictions alerting the person about his/hers physilogic risks.

This paper is organized as follows. Section 2 discusses and presents the most up to date technologies for physiologic parameters measurement, Sect. 3 presents the softcomputing applicable paradigm (the EFuNN), Sect. 4 discusses the modeling of the data for an application specific case (the dehydration), the setup of the applied EFuNN inference model (training and test), the results evaluation and the required improvements. Section 5 reports the conclusions.

2 Vital signs measurement and wearable technologies

Uninvasively measurement of vital signs with wearable devices is a challenge that deals with microelectronic technology and computing methods.

2.1 Heart rate and heart rate variability

The most important vital signs are heart rate (HR) and its variability (HRV). These vital signs embed the information concerning the autonomous nervous system (ANS) activity and cardiovascular system activity, so those are fundamental to monitor physical strain in daily life.

Heart Rate in clinical practice is measured from ElectroCardioGram (ECG) pattern detected by a set of surface electrodes applied over the skin of the chest area. ECG is a bioelectric signal of the heart muscle depolarization and repolarization during each cardiac cycle. Each cycle is an heart beat, the number of beats per minute (bpm) is the heart rate (HR). The clinical practice to measure ECG is invasive (up to ten electrodes are applied to the subject) and requires a person’s rest position.

The development of a single-lead ECG analog front-end (AFE) from Analog Devices Inc. (ADI) AD8233 (https://www.analog.com/media/en/technical-documentation/data-sheets/AD8233.pdf), an ultra-small (2 mm × 1.7 mm × 0.15 mm pitch) and ultra-low power (50 µA) Wafer Level Chip Scale Package (WLCSP) enables the ECG measurement with only two or three dry stainless steel electrodes. The light-based sensor methodology (PhotoPletysmoGraphy, PPG) enables to sense the rate of the blood flow as controlled by the heart’s pumping action. PPG is an uninvasive method to measure HR as it do not require electrodes application but only the proximity to the skin of a set of light emitters diodes (LEDs) and of a light detector (photodetector PD). PPG can be measured by the wrist or by the finger of the subject (Fig. 1).

Fig. 1
figure 1

PPG is a light-based sensor methodology to measure the rate and the dynamics of the blood flow: LED Light Emitters Diodes, PD Photo Detector, AFE Analog FrontEnd, ADC Analog to Digital Converter, PPG PhotoPletysmoGraph

PPG is also a common methodology for measuring transcutaneous oxygen saturation (TcPO2) levels in the blood. A light emitter (LED) sends its light into the body tissue, then a photodetector (PD) measures the amount of reflective or unabsorbed light (Palhalmi and Broeders 2017). The Analog Front-End (AFE) adapts analog signal to be measured and converted in digital signals by the Analog to Digital Converter (ADC).

Heart Rate (HR) is the measurement of the speed of heart contractions (beats) per minute (bpm). HR is computed from the measurement of the duration of the R–R period between two QRS intervals of the ECG pattern. It can be measured from PPG pattern too.

HRV is a measurement of the variability of the R–R intervals in the ECG pattern or the interbeat intervals in PPG pattern. This means that ECG and PPG are two fundamental measurements for further vital signs measurements (e.g. the HRV).

Analog Device Inc. (ADI) (www.analog.com) developed highly integrated solutions (devices) that enable wearable implementation of ECG and PPG. The most recent advance in this integration technology is the ADPD4000 Multimodal Sensor Front-end (https://www.analog.com/media/en/technical-documentation/data-sheets/ADPD4000-4001.pdf) that integrates in a single module Wafer Level Chip Scale Package (WLCSP) (3.11 mm × 2.14 mm, 0.4 mm pitch) all the required sensor technologies for ECG and PPG measurements.

2.2 Breathing rate

Breathing rate is a key physiological parameter used in a range of clinical settings. Its measurement is executed by physician manually by counting the breathing cycles (cycles per minute) or by elastic band sensor strap applied to the chest with the person at the rest condition.

Breathing rate could be measured from ECG by simply counting the number of ECG samples in in R–R interval (Malcangi 2021) that is a very simple computational procedure. This underline the fundamental importance of the ECG measurement and the availability of a MicroComputer Unit (MCU) to execute the required computation.

The elastic band sensor strap belongs to the wearable sensors but is not applicable because it is not reliable in normal life context and it is invasive.

Breathing rate could be measured from ECG or PPG patterns uninvasively with the state-of-art wearable technology.

2.3 Electrodermal activity (EDA)

The ElectroDermal Activity (EDA) is a measure of autonomic nervous system (ANS) activity. ANS controls the capability of human body to produce continuous variation of the electrical proprieties of the skin. EDA is also known as GSR (Galvanic Skin Response).

The skin resistance depends on sweet glands action (sweeting). The parasymphatetic nervous system controls the sweeting activity, so skin conductance measurement is an indication of the subject’s psychological and/or physiological status.

Galvanic Skin Resistance (GSR) is an old measurement practice that consisted in computing the resistance between two electrodes after a weak current is injected from one electrode (transmitter) and the other electrode (receiver) (about 2 cm apart).

ElectroDermal Activity (EDA) is a basic measure in biofeedback therapy, and it is an effective method to asses subject’s neurological status without the invasive and expensive ElectroEncephaloGraphic (EEG) method. EDA measurement is available by the state-of-art wearable technology (e.g. the highly integrated ADI ADPD4000 multimodal sensor front-end (https://www.analog.com/media/en/technical-documentation/data-sheets/ADPD4000-4001.pdf) includes EDA measurement among its capabilities).

2.4 Inertial sensing

The inertial sensing concerns the measurement of the human body rest/activity (actigraphy). Actigraphy is deployed by sensors such as accelerometers and giroscopes. Actigraphy is a measurement practice applied for the clinical diagnosis and the recovery of sleep disorders.

Accelerometers for wearable applications are available in Micro Electro Mechanical Systems (MEMS) technology in ultrasmall package Chip Scale Package (CSP), ultralow power, and ultralow cost devices such as the ADXL362 from ADI (Charlton et al. 2017).

2.5 Temperature

Temperature measurement of human body belongs to the vital signs measurements. The thermoregulation is a mechanism controlled by the central nervous system.

In clinical practice the measurement device is the thermometer, but the large availability of electronic temperature sensors enabled temperature measurement in wearable applications.

2.6 Wearable system

Wearable systems are system-on-module (SoM) that integrate in few square millimeters all the system requirements to deploy a complete e-health application such as a biofeedback application: sensors, analog signal conditioning (AFE), mixed signal electronics (ADC, DAC), analog processor, digital processor (MCU), memory (nonvolatile), communication peripherals, wireless transceiver, timing electronics, and electric power management.

The most suitable wearable format is the watch-like and/or the bracelet-like.

Wearables and brain-inspired softcomputing paradigms are enabling technologies for the development of ehealth-based applications such as biofeedback (Kasabov 2019).

AD GEN III from ADI (Fig. 2), is a watch-like wearable device that integrates all the required specifications to deploy a complete biofeedback application. AD GEN III host the required AFEs for bioelectric ECG measurement, the LED drivers and the photosensor (PD) for PPG measurement, the accelerometer, the EDA settings, the temperature sensor, the nonvolatile memory, the MCU, the Bluetooth Low Energy connectivity (BLE), the Universal Serial Bus (USB) connectivity and the electric power management.

Fig. 2
figure 2

AD GEN II and AD GEN III Integrated wearable device from ADI (Courtesy of Analog Devices Inc.: www.analog.com)

3 Biofeedback: EFuNN based system framework

Wearables and brain-inspired softcomputing paradigms are enabling technologies for the development of ehealth-based applications such as the biofeedback (Kasabov 2007; https://kedri.aut.ac.nz/areas-of-expertise/data-mining-and-decision-support/neucom).

Unlike artificial neural networks (ANNs) that were developed to learn from data, a new class of softcomputing paradigms, the Evolving Connectionism Systems (ECOS) were developed (Kasabov 1998). These meets the requirements of learning in adaptive, incremental way from measurements that origin from evolving processes. The [Evolving Fuzzy Neural Networks (EFuNNs) and the Evolving Spiking Neural Networks (ESNNs)] are the most promising to accomplish the requirements of the wearable biofeedback e-health applications (Kasabov 2019).

ECOS are ANNs with learning algorithm capable to modify the ANN’s structure at training time. The learning algorithm is designed to enable the one-pass learning and online learning: quick learning due to the one-pass algorithm’s nature and aggregation enable the modification of the network as training is running.

The term evolving is not to be confused with evolutionary because ECOS do not apply evolutionary computations such as fitness, mutation, reproduction but computations that executes changes through the time.

3.1 Evolving Fuzzy Neural Networks

The Evolving Fuzzy Neural Networks (EFuNNs) are Artificial Neural Networks (ANNs) that merge both the fuzzy logic inference of a fuzzy logic engine and the ANNs capabilities to learn by data. The EFuNN is an implementation of the Evolving COnnectionist System paradigm (ECOS) (Kasabov 2007), so it enables on-line adaptation and real-time evolution. Evolution is incremental and adaptive, that is matching the requirements of applications such as the biofeedback.

The EFuNN is a five layer Feed Forward ANN architecture. The EFuNN’s layers are full implementation of the fuzzy logic framework (Fig. 3). The first layer implements the input (crisp) data, so the second layer (condition layer) executes the fuzzification of the crisp inputs. Each neuron of the second layer is a membership function (triangular MF) connected to a single input neuron so that the crisp input is fuzzified according to the related MF. The weight of the connection between the condition neuron and the input neuron is the centre of the MF. The MF’s bounds (upper and lower) are the center of the neighbouring MF (neurons). The third layer encodes and executes the inference by rules on the fuzzyfied input data. This layer implements the evolving capability of the EFuNN. According to the fuzzy logic framework this layer is the rule layer. The fourth layer infers the fuzzy outputs as it executes the implication by means of MF neurons and connects the results one-to-one to the output neurons for defuzzification (crisp output). Similarly to the condition layer MFs, the action layer MF’s center is defined by the connection weight between the action neuron and its output neuron. The fifth layer defuzzifys the action layer inference applying the centre gravity method (1) to produce the crisp output.

$$A_{0} = \frac{{\sum\nolimits_{a = i}^{m} {W_{o,a} A_{a} } }}{{\sum\nolimits_{i = 1}^{n} {A_{a} } }}$$

Ao: activation of the output node o; Aa: activation of the action node a; m: number of activation neurons connected to node o; Wo,a: connection weight from action node a to output node o.

Fig. 3
figure 3

EfuNN architecture merges the Fuzzy Logic framework and the Feed Forward ANN framework

The EFuNN’s learning process consists of eight steps: initiation, input feeding, connecting, tuning, node aggregation, node pruning, rule estraction.

Aggregation is the process that combine several adjacent nodes into one that represents such neurons for the specific region. The distance computation is the method to decide to execute the aggregation. The aggregation could be executed online at training time or offline after training was completed.

Pruning is the process that reduces the complexity and increases the speed by reducing the number of neurons applying a rank criteria (how much the neuron contributes, the mean activation of the neuron, and other creative criterias): low ranking neurons could be removed, so the network results smaller and faster, fullfilling the requirements of deeply-embedded systems such as the wearables.

The five layer fuzzy engine (Mamdani) overlaps the five layer of the Feed Forward (FF) ANN architecture, so the EFuNN capability to learn by data is applied to setup the knowledge of the fuzzy logic (rules and membership functions) by supervised/unsupervised learning.

The peculiarity of EFuNN is its capability to learn in a one pass and that the knowledge, encoded as rules and membership functions in the nodes, could be modified at training time.

The bioinspired nature of the EFuNN paradigm make more effective the learning process by its evolving capability.

3.2 Biofeedback system framework

The biofeedback system framework (Fig. 4) consists of the hardware setup and the software setup. The hardware setup consists of a set of sensors for vital signs measurements (electrodes, photo sensor, accelerometer, thermistor), the analog front-end (AFE), the mixed-signal electronics analog to digital converter and digital to analog converter (ADC and DAC), the digital electronics and the microcontroller unit (Memory, Logics, MCU), the communication electronics (wired and wireless), and the electric power management (rechargeable battery), all packaged in a watch format.

Fig. 4
figure 4

Biofeedback system framework

The software setup consists of a set of digital signal processing algorithms (DSP) to execute the measurements of vital signs from the signal captured by the sensors, the system software to manage the system resources (MCU, memory, communication), the prediction and the inference paradigm (EFuNN).

3.3 Hardware deploy

The biofeedback system application was deployed on the wearable reference design AD GEN II, wirelessly connected to a smartphone computing platform (host) running the application that manages the biofeedback.

AD GEN II and AD GEN III from ADI (Analog Devices Inc.) (Fig. 2), are watch-like wearable devices that integrates all the required specifications to deploy a complete biofeedback application. AD GEN III host the required AFEs for bioelectric ECG measurement, the LED drivers and the photosensor for PPG measurement, the accelerometer, the EDA settings, the temperature sensor, the nonvolatile memory, the MCU, the Bluetooth connectivity and the electric power management.

4 Case study: dehydration prediction and recovery

To test the biofeedback system framework a reference application has been simulated targetted to the prediction of the dehydration physiologic condition, from Electro Dermal Activity (EDA) and Heart Rate (HR) measurements.

The prediction paradigm applied is EFuNN, ran in the simulation environment NEUCOM from the Knowledge and Engineering Discovery Research Institute (KEDRI) (Bulaj 2014).

4.1 Dataset, training and test

To train and test the EFuNN for prediction of normal/dehydration status, a dataset was built with EDA and HR data collected over 3 days dry of subject’s dehydration status and 3 days hydration status. Such measurements consist of sequences of measurements (samples): EDA, HR labeled and formatted as follow:

$${\text{E}}_{1} \;{\text{H}}_{1} \;{\text{E}}_{2} \;{\text{H}}_{2 } \;{\text{E}}_{3} \;{\text{H}}_{3 } \;{\text{E}}_{4} \;{\text{H}}_{4 } \;{\text{E}}_{5} \;{\text{H}}_{5 } \;{\text{E}}_{6} \;{\text{H}}_{6} \cdots {\text{E}}_{{\text{j}}} \;{\text{H}}_{{\text{j }}} \;{\text{E}}_{{\text{N}}} \;{\text{H}}_{{\text{N }}} \;{\text{L}}_{{\text{n}}}$$
$${\text{E:EDA}}; \quad {\text{H:HR}}\quad {\text{L:label}}$$

Ej Hj: j-th amplitude of the j-th measure of the n-th pattern; Ln: n-th label associated to the n-th sequence.

$${\text{EDA:}}\left[ {\upmu {\text{S}}} \right], \quad {\text{HR:}}\left[ {{\text{BPm}}} \right]$$

EDA and HR measurements were been executed 10 per second. The measurements are real numbers packaged in a Comma-Separated Values (CSVs) format. No digital signal processing (DSP) algorithms was been applied to data for features extraction. Measurements was been applied as row-data.

Each sample will feed the EFuNN’s inputs at training time for training purpose and at test time to check its inference capability. For training purpose the dataset (Fig. 5a) was been splitted randomly in two parts: 20% (Fig. 5b) for test purpose and 80% (Fig. 5c) for training purpose.

Fig. 5
figure 5

Dataset to train and test the EFuNN to predict dehydration: a 100%, b 20% randomized, c 80% randomized

After training the EFuNN demonstrated reliable prediction capability (Fig. 6), confirmed at test time (Fig. 7): minimal error resulted in the output’s prediction (lower than 1.0%).

Fig. 6
figure 6

Training and test of the EFuNN with 80% scrambled dataset’s samples

Fig. 7
figure 7

Test of the EFuNN with 20% scrambled dataset’s samples

The setup of the EFuNN simulator was as follows:

  • Sensitivity Threshold: 0.9;

  • Error Threshold: 0.1;

  • Number of Membership Functions: 3;

  • Learning rate for: W1: 0.1;

  • Learning Rate for W2: 0.1;

  • Pruning: On;

  • Node age: 60;

  • Aggregation: On.

W1 is the connection weight representing the co-ordinate of the centre of the sphere in the fuzzy input space. W2 is the co-ordinate in the fuzzy output space.

The sensitivity threshold defines the minimum activation of a rule node.

5 Conclusion

The test confirmed the effectiveness of the biofeedback framework proposed and that it could be successfully applied to other short term prediction cases (e.g. physical activity) and long term predictions such as cardiovascular diseases (infarction, stroke) and neurodegenerative diseases (Parkinson, Alzheimer).

Long term e-health biofeedback could consist in a black-box-like wearable device for continuous acquisition, measurement and inference of all vital signs applicable to the early prediction of the incoming diseases.

Acting as a black-box, the device could store data over long period (whole life duration) useful to investigate about the correlation between vital signs and a specific disease, so effective and reliable datasets could be collected to train and test the targeted artificial intelligence paradigms.