Real-Time Multi-Ion-Monitoring Front-End With Interference Compensation by Multi-Output Support Vector Regressor

—Ion-sensors play a major role in physiology and healthcare monitoring since they are capable of continuously collecting biological data from body ﬂuids. Nevertheless, ion interference from background electrolytes present in the sample is a paramount challenge for a precise multi-ion-monitoring. In this work, we propose the ﬁrst system combining a battery-powered portable multi-channel electronic front-end, and an embedded Multi-output Support Vector Regressor (M-SVR), that supplies an accurate, continuous, and real-time monitoring of sodium, potassium, ammonium, and calcium ions. These are typical analytes tracked during physical exercise. The front-end interface was characterized through a sensor array built with screen-printed electrodes. Nernstian sensitivity and limit of detection comparable to a bulky laboratory potentiometer were achieved in both water and artiﬁcial sweat. The multivariate calibration model was deployed on a Raspberry Pi where the activity of the target ions were locally computed. The M-SVR model was trained, optimized, and tested on an experimental dataset acquired following a design of experiments. We demonstrate that the proposed multivariate regressor is a compact, low-complexity, accurate, and unbiased estimator of sodium and potassium ions activity. A global normalized root mean-squared error improvement of 6 . 97% , and global mean relative error improvement of 10 . 26% , were achieved with respect to a standard Multiple Linear Regressor (MLR). Within a real-time multi-ion-monitoring task, the overall system enabled the continuous monitoring and accurate determination of the four target ions activity, with an average accuracy improvement of 27 . 73% compared to a simple MLR, and a prediction latency of 22 . 68 ± 1 . 73 µ s.


Real-Time Multi-Ion-Monitoring Front-End With Interference Compensation by Multi-Output Support
Vector Regressor Mandresy Ivan Ny Hanitra , Member, IEEE, Francesca Criscuolo , Sandro Carrara , Fellow, IEEE, and Giovanni De Micheli , Fellow, IEEE Abstract-Ion-sensors play a major role in physiology and healthcare monitoring since they are capable of continuously collecting biological data from body fluids.Nevertheless, ion interference from background electrolytes present in the sample is a paramount challenge for a precise multi-ion-monitoring.In this work, we propose the first system combining a battery-powered portable multi-channel electronic front-end, and an embedded Multi-output Support Vector Regressor (M-SVR), that supplies an accurate, continuous, and real-time monitoring of sodium, potassium, ammonium, and calcium ions.These are typical analytes tracked during physical exercise.The front-end interface was characterized through a sensor array built with screen-printed electrodes.Nernstian sensitivity and limit of detection comparable to a bulky laboratory potentiometer were achieved in both water and artificial sweat.The multivariate calibration model was deployed on a Raspberry Pi where the activity of the target ions were locally computed.The M-SVR model was trained, optimized, and tested on an experimental dataset acquired following a design of experiments.We demonstrate that the proposed multivariate regressor is a compact, low-complexity, accurate, and unbiased estimator of sodium and potassium ions activity.A global normalized root mean-squared error improvement of 6.97%, and global mean relative error improvement of 10.26%, were achieved with respect to a standard Multiple Linear Regressor (MLR).Within a real-time multi-ion-monitoring task, the overall system enabled the continuous monitoring and accurate determination of the four target ions activity, with an average accuracy improvement of 27.73% compared to a simple MLR, and a prediction latency of 22.68 ± 1.73 µs.Index Terms-Front-end interface, healthcare monitoring, multi-ion-monitoring, multivariate calibration, physiology, realtime monitoring.
Color versions of one or more figures in this article are available at https://doi.org/10.1109/TBCAS.2021.3118945.
Digital Object Identifier 10.1109/TBCAS.2021.3118945monitoring of biomarkers that are indicators of physiological and healthcare status [1]- [3].In particular, they could be integrated into smart and portable sensing front-end interfaces enabling a real-time healthcare monitoring [4].For instance, in sport applications, wearable sweat sensors are used to monitor muscle activity and fatigue by tracking potassium and ammonium ions concentration [5], [6].Dehydration is indicated by sodium ions level [7], while bone mineral loss is measured through calcium ions concentration [8].The aforementioned ions are relevant as well for healthcare monitoring applications, since they are indicators of cystic fibrosis, hypo-or hyperkalemia, liver or kidney physiological dysfunctions [9], [10].Most research and development around ion-sensors are focused on improving transduction mechanisms of Ion-Selective Electrodes (ISEs), endeavoring to increase sensor sensitivity, selectivity, and robustness, for a single target electrolyte [11].Nevertheless, a multi-ion-sensing platform is desirable for a comprehensive physiological insight of the subject under test, in order to assert a correct electrolytic balance, and because of correlations between several biomarkers' concentration [12].Besides, a multi-sensing platform is suitable to understand and tackle ion interference phenomena.The latter is strongly degrading sensing performances due to intrinsic sensor crossselectivity bounds [13].Ion interference is even more severe in unbalanced electrolyte media such as sweat samples, where sodium and potassium ions are present at high concentration.Therefore, tracking diluted analytes such as ammonium or calcium ions becomes intricate because of interference from the two prevalent ions.Chemometric tools are increasingly applied in multi-analytesensing, where advanced mathematical and signal processing methods are implemented to improve sensing performances [14].Multivariate calibration models are built in order to bind the electrical responses transduced by the sensor array to the concentration or activity of the target ions.Complex Artificial Neural Network (ANN) architectures were presented in literature to overcome ion interference phenomena, for several ion-sensing applications [15]- [23].For instance, in [16], a genetic algorithm followed by a feed-forward neural network was implemented to simultaneously determine six ions from an ISE array, in water samples.However, these processing models require expensive computation and memory resources, mainly during the calibration phase, have a higher latency, and are aimed to be used in post-processing pipelines in bulky systems.We have recently presented in [24], a Multi-output Support Vector Regressor (M-SVR), that has been demonstrated to be a compact, accurate, robust, and low-complexity multivariate calibration model for sodium, potassium, lithium, and lead ions monitoring, in various healthcare applications.The regressor was trained and evaluated with emulated synthetic datasets of different size, where a compact ion-sensing model was implemented to simulate ion-sensor responses in artificial sweat.
In this work, we propose a complete electronic tongue system coupling: a multi-ion-sensor array, an electronic front-end interface, and the M-SVR calibration model deployed on an edge device, enabling an accurate, continuous, and real-time determination of sodium, potassium, ammonium, and calcium ions in artificial sweat, for physiology applications (see Fig. 1).The manuscript is organized as follows: Section II describes the different parts of the system, i.e., the sensing interface, the hardware front-end, and the proposed M-SVR model; in Section III, the material and methods implemented in this work are detailed; the characterization and validation of the front-end interface and embedded multivariate regressor are presented and discussed in Section IV; the conclusions are provided in Section V.

II. SYSTEM OVERVIEW
The proposed system for real-time multi-ion-monitoring is shown in Fig. 2. The multi-ion-sensing panel consists of four solid-contact ISEs fabricated on commercial Screen-Printed Electrodes (SPEs), enabling concurrent sodium, potassium, ammonium, and calcium ions sensing in artificial sweat samples.A double-junction Ag/AgCl reference electrode was used as potential reference.The sensing panel was interfaced to an analog front-end carrying out Open Circuit Potential (OCP) acquisition and signal conditioning.The hardware was powered by a 3.7 V lithium ion battery.The processed signals were relayed to a Raspberry Pi 4B through Bluetooth Low Energy (BLE) technology.A smartphone was used as control terminal for the edge device through a Virtual Network Computing (VNC) session.A Graphical User Interface (GUI) developed in PyQt5 was executed on the Raspberry Pi, enabling user configuration of the measurements performed by the sensing front-end.Then, when the measurements started, the collected OCP signals were fed to the trained embedded M-SVR model that computed the activity of the four target ions, and the results were displayed in real-time on the GUI.The sensor panel, the analog front-end interface, and the proposed M-SVR model are described in this section.

A. Sensor Panel
The multi-ion-sensing array consists of four solid-contact ISEs built on ceramic SPEs, as shown in Fig. 3.Such technology is robust and facilitates the acquisition of large datasets for the validation of the front-end interface and the training of the multivariate calibration model.The functionalization of the ionsensors is thoroughly described in Section III-B.A temperature sensor is also needed to monitor in situ temperature for on-body measurements.As a result, a Resistive Thermal Device (RTD) was microfabricated on a polyimide flexible substrate.Platinum serpentine-shaped wire of 20 foldings, with a width of 130 μM, was patterned with lithographic techniques.The complete microfabrication process flow was described in [25].The nominal resistance of the device is of 1.2 kΩ at room temperature.

B. Readout Circuits
The front-end circuit was built with commercial off-the-shelf components, and comprises four ion-sensing channels and a temperature readout circuit for monitoring body temperature.
Ion-sensing was accomplished by a potentiometric readout circuit, as illustrated in Fig. 5(a).The potential of the ISE was measured against a reference electrode of stable potential, in open circuit conditions.Namely, MAX44242 voltage buffers of 500 pA input bias current ensured a quasi-null current polarization of the electrochemical cell.Such tiny current is needed, though, in order to increase sensor sensitivity and to reduce sensor potential drifts [26].A single-ended differential amplifier was used to resolve the OCP between the ISE and the shared reference electrode.An amplification gain of 3.96 was implemented so as to use the whole dynamic range of the Analog-to-Digital Converter (ADC).A fourth-order low-pass filter was obtained by cascading two second-order Sallen-Key low-pass filters of Fig. 5(b).A corner frequency of 1.37 Hz was designed, considering that the cell potentials are DC signals.Moreover, four independent readout channels were replicated to monitor the four target ions.
As for in situ temperature measurement, the resistance of the RTD varies in a predictable way with temperature [27].Therefore, a resistance-to-voltage converter was implemented, where the RTD was polarized by a DC current source, and the voltage across the device was measured.A straightforward Fig. 2. Real-time multi-ion-monitoring system comprising the sensing panel that is interfaced to a battery-powered portable analog front-end, and a Raspberry Pi on which the M-SVR is deployed for the prediction of the activity of the four target ions.A smartphone serves as terminal for the edge node through a Virtual Network Computing session.solution is to implement a voltage divider like in [28], [29], but loading effects might degrade sensing accuracy.Moreover, the current source should be designed carefully so as to avoid over-heating the RTD.The proposed circuit is displayed in Fig. 5(c).A DC current source was obtained with an improved Howland current source [30], where a precision shunt-mode voltage reference of 1 V was the controlling input.The operational amplifier OA1 sensed the input and the feedback signal differentially, setting a voltage drop of 1 V across R ref = 1 kΩ.The DC output impedance of the current source was of 333 MΩ, and the current pump output a stable DC current of 1 mA to polarize the RTD.The voltage across the thermistor was sensed by OA3, and a Sallen-Key low-pass filter was added to attenuate high-frequency noise.The Howland current source was sized so as to measure nominal resistances of 1.2 kΩ, that corresponds to the approximate value of the microfabricated RTD at room temperature.

C. Hardware Front-End
The analog front-end interface is displayed in Fig. 4. It was manufactured on a 1.6 mm FR4 rigid substrate, with dimensions of 30 × 45 mm that are compliant for an integration onto a wearable sensing system.A seven-position flat-flex type edge connector was soldered to interface the hardware to an integrated sensing platform such as in [31], but micro USB-B connectors were soldered for prototyping and for the measurements performed on SPEs that are presented in this work.A lowpower ATxMega32E5 Micro-Controller Unit (MCU) operating at 32.768 kHz, with a 8/16-bit AVR RISC CPU, is the core processing unit.It embeds a 12-bit resolution sample-and-hold ADC.Oversampling and decimation were implemented in order to achieve 16-bit resolution.In multi-sensing mode, the four potentiometric channels were scanned and sampled at 4.096 kHz, where conversions were triggered successively.The MCU features a serial port UART interface that was used to convey and receive commands and data to/from a RN4871 BLE 4.2 module.The latter was configured through ASCII commands during firmware initialization.The readout front-end was powered by a 3.7 V lithium ion rechargeable battery with a capacity of 2 Ah.MCP1801, low quiescent current, low dropout voltage regulators were used to supply stable 3.3 V to the analog blocks, to the MCU, and to the on-board Bluetooth module.
A Raspberry Pi 4B was used as an edge node to configure the front-end readout circuit, and to perform the real-time determination of the four target ion activity through the M-SVR model it embeds.The hardware supports a 64-bit quad core Cortex-A72 processor (armv71 architecture), with 4 GB LPDDR4 RAM.It features Bluetooth 5.0 BLE, and 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless connectivity.A 32 GB micro-SD card was used to store the Raspbian operating system image, the open source software libraries, drivers, and applications, and to store the data acquired during measurements.A smartphone was used as display and control terminal of the Raspberry Pi through a VNC session.W, b) is the regressor model comprising the regression coefficients and the bias term, and E is the matrix of prediction error.The proposed M-SVR model is a multi-input multi-output regressor that is more robust to noise and non-linearity than a traditional single-output SVR, since it considers linear and non-linear cross-correlations between X and Y. Thus, each column of W are optimized concurrently.The objective function is

D. Multi-Output Support Vector Regressor
where Φ is the non-linear function defining the kernel function C is an hyper-parameter tradingoff soft margin violations and minimization of the distance from the support vectors to the SVR model.L is a cost function defined as A quadratic cost-function is necessary to pack the constraints for all M output dimensions into a single error vector, that is not possible with L 1 -based Vapnik loss function typically used in single-output SVR [32].The M-SVR problem was solved using an Iterative Reweighted Least-Squares (IRWLS) procedure.The latter was obtained by performing a first-order Taylor approximation of (2) over the previous solution (W, b), and by doing a quadratic approximation of the resulting expansion.The IRWLS problem at the k th iteration is where ( The proof of convergence of the IRWLS procedure was demonstrated in [33], and the minimization implementation of (3) has been presented in [24].It results that the procedure converges in less than 15 iterations, each iteration having the complexity of M Ordinary Least-Squares (OLS) minimization.This makes the proposed model appealing compared to singleoutput SVRs that uses quadratic programming [34].

III. MATERIAL AND METHODS
In this section, the material and methods implemented in this work are described.

A. Chemicals
All chemicals were purchased from Merck (Germany) unless otherwise stated.These include H 2 P tCl 6 , H 2 SO 4 , 4-tert-Butylcalix [4] The artificial sweat composition is detailed in Table I, considering the nominal concentration of the electrolytes and organic compounds typically constituting sweat samples.Sodium, potassium, ammonium, and calcium ions are the target ions for this application.Magnesium ions are diluted in artificial sweat, so they are not relevant to monitor.

B. Ion-Sensors Fabrication
Ceramic SPEs (platinum working electrode with 12.56 mm 2 active area; platinum counter electrode; silver reference electrode) were purchased from Metrohm (Switzerland).An Autolab PGSTAT 302 N potentiostat was used for the electrochemical nanostructuration of the ISEs.
The working electrodes of the SPEs were cleaned by cyclic voltammetry cycles in 0.5 M H 2 SO 4 .Then, platinum nanostructures were deposited by applying −1 V in (25 mM H 2 P tCl 6 , 50 mM H 2 SO 4 ) solution, following the conformal procedure from [35].Next, 10 μL of ion-selective membrane (ISM) cocktail was drop-casted on top of the electrode.The composition of the different ISMs are summarized in Table II.The ISEs were left to dry overnight.The ion-sensors were conditioned with a solution of the corresponding target ion at least one day before the measurements.Namely, solutions of 10 mM were prepared for sodium and potassium ion-sensors, while solutions of 1 mM were prepared for ammonium and calcium ion-sensors, since these are approximately the nominal concentrations of these analytes in sweat.

C. Design of Synthetic Training and Test Sets
The multivariate calibration model was trained and optimized before being deployed for inference.The training dataset should be representative enough of sweat compositions obtained during physical exercise, but acquiring Big Data is extremely expensive in terms of chemical resources and time.As a result, an experimental dataset was obtained following a factorial design of experiments.Taguchi method was implemented to generate The four levels in the orthogonal array correspond to discrete values of ion activity.Therefore, the activity of the electrolytes were quantized over their detection range, as shown in Table IV.
Seven levels were used so as to obtain a finer subdivision of the detection range, and in order to tune the size of the training set.Namely, eight four-level factor combinations of these seven discrete ion activities were used in the orthogonal array, yielding a synthetic dataset of 16 • 8 = 128 samples, as illustrated by Fig. 6.This dataset size is large enough to train the M-SVR model accurately [24].
As for the validation and test set, artificial sweat compositions were designed by random sampling over the range of activity of the constituting ions.A Weibull distribution was used (scale = 0.5, shape = 2), yielding 32 validation, and 32 random test samples.

D. Real-Time Multi-Ion-Monitoring Validation Setup
Real-time multi-ion-monitoring in artificial sweat was performed, emulating physical activity that leads to a steady

E. Software
Data processing pipeline and multivariate models were implemented within a Python 3.7 environment.OLS minimization was performed with Singular Value Decomposition (SVD), where LAPACK routine [36] was used.The other multivariate calibration models used as benchmark for M-SVR were implemented as follows.Multiple Linear Regression (MLR) was carried out as multiple OLS minimizations.Single-output SVRs were constructed leveraging LIBSVM library that supports quadratic programming [34].Moreover, feed-forward neural network models were implemented through Keras high-level API [37], with TensorFlow 2.0 deep learning library as computational back-end.

IV. RESULTS AND DISCUSSION
In this section, all the parts constituting the proposed electronic tongue system are characterized and validated in order to assess its performance for a real-time multi-ion-monitoring task, where accuracy, robustness, latency, and portability are the principal figures of merit considered.

A. Analog Front-End Electrical Characterization
The readout circuitry of the analog front-end interface were characterized electrically.First, a DC voltage between 0 mV and 540 mV was applied between the potentiometric channel input and the grounded reference electrode terminal.The output voltage was measured and plotted in Fig. 7(a).A voltage gain of 3.96 was obtained for the four channels, that corresponds to the gain of the amplification stage of the differential amplifier.An excellent linearity was observed (R 2 > 0.9999, RM SD = 0.70 mV with respect to the linear fit), with an input range of [20; 520] mV.An integrated input-referred voltage noise of 0.2286 μV was computed in the range [1e − 3; 1.4] Hz.Likewise, the resistanceto-voltage converter implemented for temperature measurement was characterized by sampling the output voltage while different high-precision value resistors ranging from 120 Ω to 1.9 kΩ were applied at the input of the readout circuit.The results are displayed in Fig. 7(b), showing a sensitivity of 1.0032 mV/Ω, and a good linearity (R 2 > 0.9998, RM SD = 6.74 mV with respect to the linear fit), with an input range of [120; 1800] Ω.For both potentiometric and resistance readout, the results of the PSpice model simulations of the circuit blocks are displayed in Fig. 7, highlighting an excellent electrical behavior of the readout circuitry.
Regarding portability and connectivity, the BLE module features a Received Signal Strength Indicator (RSSI) of −51 dBm at 1 m.It was only active during data transactions, where a sampling rate of ten samples per second was used for singlechannel acquisition (single ion, or temperature measurement), and five samples per second for monitoring the four potentiometric channels simultaneously.The sensing interval time could be tuned by the user through the GUI executed on the Raspberry Pi.As for the power budget, the average power consumed by the hardware was of 135 mW, where 90.45 mW was absorbed by the analog circuitry (four ion-sensing channels: 68.2 mW, temperature readout: 22.25 mW), 35.1 mW was consumed by the digital components, and 9.45 mW was spent during BLE transactions.With the 3.7 V and 2 Ah capacity Li-ion battery used, the front-end interface supports a lifetime of 54 hours of multi-sensing measurements, largely sufficient for continuous monitoring applications.

B. Analog Front-End Electrochemical Characterization
The analog front-end interface was characterized with the fabricated ISEs and the RTD sensor.The ISEs were first characterized in water samples to assess a correct Nernstian behavior.Then, they were used in artificial sweat samples.Sensor calibrations were performed with target ion concentrations ranging from 10 −9 M to 10 −0.5 M, for sodium, potassium, ammonium, and calcium ions.Identical experiments were carried out with an EMF6 Lawson Labs precision electrode interface in order to evaluate the performance of the hardware front-end.The results are reported in Table VI, where five sensors were built for each type of ISE, for statistical significance.Typical calibration curves are displayed in Fig. 8, with sodium-ISEs, in artificial sweat.We observe that all solid-contact ISEs exhibit Nernstian responses in both water and artificial sweat.Sensor sensitivity are slightly lower in artificial sweat background due to ion interference.The sensor lower LODs are reported as well.It indicates the minimum detectable quantity of target ion.It is computed as the intersection of the two linear portions of the calibration curve.Namely, the flat potential regime, and the detection range exhibiting a Nernstian slope (see Fig. 8 for illustration).Sensor lower LODs are much larger in artificial sweat than in water.This is due to the interfering background electrolytes that shift the flat potential up, pushing the elbow of the calibration curve to higher ion activity, thus reducing the lower detection range [38].Nevertheless, the lower LODs remain several factors of magnitude below the lower bound of range of interest of the target ions.Besides, the results obtained  with the hardware front-end are comparable with the ones obtained with the bulky EMF6 Lawson Labs potentiometer.
Next, RTD sensors were characterized with the hardware front-end.The temperature was controlled using a VWR Professional Hotplate in the range [34; 43] • C. The sensors patterned on a flexible polyimide substrate were directly interfaced to the edge connector of the hardware, reducing contact resistances.The calibration curve is displayed in Fig. 9, showing a sensitivity of 6.56 mV/ • C, and an excellent linearity (R2 = 0.9983, RM SD = 0.7719 mV).Thus, the readout circuit has been designed correctly, around the operating point of the RTD, i.e. at 1.2 kΩ.

C. Multi-Output Support Vector Regressor Training, Optimization, and Testing
This section discusses the training and optimization of the proposed M-SVR model.Training, validation, and test datasets were acquired following the design of experiments described in Section III-C.Namely, OCP from sodium, potassium, ammonium, and calcium ion ISEs were measured in different samples, with pre-determined electrolyte composition.In practice, the potentials were measured, first, in blank samples (artificial sweat containing only organic compounds), and then the sensor responses were measured in presence of the constituting ions.Such differential measurement lowers  ,K + = −1.37 were measured with fixed-interference method, suggesting that the interfering ions have a higher contribution to the potential observed at these ISEs.As for the 32 validation and 32 test samples, they were acquired with random sample composition, thus, the activity of the analytes span the whole detection range of the four target ions.
Next, the experimental dataset was used to train the M-SVR model.The input tensor was standardized to zero-mean and unit-variance.The labels used were the logarithm in base 10 of the activity, since E vs log a is linear for sensors exhibiting a Nernstian response, without ion interference.Non-linear kernel functions were used to cope with the non-linearity introduced by ion interference in the dataset.Therefore, polynomial kernel κ poly (x i , x j ) = (γ x i , x T j + b) d , and Gaussian Radial Basis Function (RBF) κ rbf (x i , x j ) = exp(−γ||x i − x j || 2 ) were implemented.The model hyper-parameters (C and ) and the kernel hyper-parameters were optimized using a grid-search procedure.Namely, for each set of hyper-parameters, the M-SVR model was trained and evaluated with the validation set.The Normalized Root Mean-Squared Error (NRMSE) and Mean Relative Error (MRE) were the metrics used throughout this work.They are defined as Where y is the mean of the test set labels, y n and ŷn are the ground truth and predicted log-activity of the primary ions, respectively.Normalized metrics are required to balance error contributions from analytes highly concentrated (sodium ions), and diluted analytes in the sample (calcium ions).In addition, the two metrics do not over-penalize outliers.Compact metrics are obtained by summing the NRMSE and MRE for each of the four target ions, yielding Total_NRMSE and Total_MRE.
The heatmaps displayed in Fig. 11 show the Total_NRMSE obtained with a polynomial and Gaussian RBF kernel.For visualization purposes, the hyper-parameters d, b, and were fixed, and the plot illustrates the impact of C and γ on the accuracy of the regressor.C and γ were selected by trading-off model generalization capability, and risk of over-fitting to the training dataset.Lower values of C were chosen, for identical accuracy achieved, since it constrains less the model, hence, reduces over-fitting.The best M-SVR model was then evaluated on an external test set, of one-fourth of the size of the training set.Polynomial M-SVRs yield slightly better results than Gaussian RBF ones.The metrics obtained with such kernel M-SVR are reported in Table VIII.
Calcium-ISEs seem to be predicted better since they have a higher selectivity with respect to monovalent cations, and magnesium ions that are interfering with calcium sensors are rather diluted in artificial sweat.Larger prediction errors were obtained for potassium and ammonium sensors that suffer from interference due to lower sensor cross-selectivity.As for sodium-ISEs, they exhibit a rather good linearity in the training dataset (see Table VII), suggesting the use of a linear model.However, we recall that M-SVR is a multivariate multi-output regressor that optimizes the calibration of the four ions concurrently, and not independently like with single-output SVRs.This explains the higher prediction error observed for sodium sensors.The M-SVR model accuracy was evaluated by plotting the predetermined ion activities against the predicted ones, for the four target ions (see Fig. 12).The scatter plots are dispersed along the 1:1 line for both sodium and potassium ions, where the 95% confidence interval of the slope and intercept of the fitted model contain one and zero, respectively.It results that M-SVR is an unbiased estimator for sodium and potassium ions prediction.The model prediction is not consistent for the determination of ammonium and calcium ions.This is due to dataset scarcity and/or to the severity of ion interference for these sensors.

D. Benchmarking With Other Multivariate Calibration Models
Different multivariate calibration models were used to benchmark the proposed M-SVR model.Namely, a simple MLR, single-output SVRs, and Multi-Layers Perceptron (MLP) models were implemented.For the configuration of MLP models, refer to the work presented in [24].An hyper-parameters gridsearch similar to the one detailed in Section IV-C was performed.The metrics obtained during the training and testing phases are displayed in Fig. 13.Non-linear regressors improve prediction accuracy compared to a simple linear model.NRMSE improvements of 9.14, 6.97, 7.85%, and MRE improvement of 18.45, 10.26, 12.31% were achieved with single-output SVRs, M-SVR, and MLP model, respectively.The multivariate calibration models generalize well with unseen data since the metrics during the test phase are better than in validation phase.Single-output SVRs provide the least prediction error.However, we recall that the latter consist of four uncorrelated regressors that optimize the prediction of the four target ion activity independently.Hence, a SVR closer to a linear-SVR was obtained for predicting sodium ions activity, and a non-linear SVR was more suitable for ammonium ions.Conversely, M-SVR and MLP models are multivariate models.They are built by taking into account correlations in the multidimensional output, namely, the four target ions activity.Moreover, the multivariate models accuracy was evaluated by regressing the pre-determined ion activities against the predicted values.The slope and intercept of the linear fit with a 95% confidence interval, the Root Mean-Squared Deviation (RMSD) of the predicted ion activities against the 1:1 line, and the Theil's partial inequality coefficients are reported in Table IX.The latter are the decomposition of the sum of squared of predicted errors into the proportion associated with mean difference between log a X and log a X (U bias ), the proportion associated with the slope of the linear fit and the 1:1 line (U slope ), and the proportion associated with the variance in log a X unexplained by log a X (U error ).The coefficients provide an assessment of model goodness-of-fit [39].It results that a bare MLR model is an inconsistent estimator for the prediction of all four target ions, plus it has larger prediction errors that reflect its inability to cope with ion interference.SVR models are unbiased estimators for the prediction of sodium ions only.M-SVR and MLP models are unbiased estimators of sodium and potassium ions.We observe that the prediction of ammonium and calcium ions are more intricate due to the larger prediction error owing to bias and slope misleading.
Furthermore, the multivariate models complexity was compared.An average training runtime of 1.81 ms, 13.97 ms, 8.18 ms, and 14.01 s was obtained with MLR, single-output SVRs, M-SVR, and MLP models, respectively.The iterative procedure of the proposed M-SVR converges quickly, typically in 11 iterations.Each iteration having the complexity of M OLS minimizations.The single-output SVR model embeds four times more support vectors than M-SVR, since four independent regressors were trained.Eventually, the extremely slow training of the neural network model, with 1079 trainable parameters and 228 training epochs, highlights the larger complexity of such multivariate regressor.Therefore, the proposed M-SVR is a low-complexity model suitable to be implemented or deployed on energy and memory-constrained computational resources such as a microprocessor unit or a smartphone.

E. Real-Time Multi-Ion-Monitoring
After optimizing and characterizing the ion-sensors, the analog front-end interface, and the embedded multivariate calibration model, these blocks are co-integrated to form an electronic tongue system evaluated for a real-time multi-ion-monitoring task.Before the measurement, the solid-contact ISEs were calibrated in water samples.These calibration curves will be used to estimate ion activities with a classical MLR model.The real-time multi-ion-sensing experiment started by exposing the four ISEs to an artificial sweat sample.The Raspberry Pi was powered-on, and a VNC session was launched through a smartphone.The control GUI was executed on the edge node.Then, the analog front-end circuit was powered, and the different on-board modules were configured during firmware initialization (system clock, sleep manager module, ADC module, UART interface, Bluetooth module).The BLE module started advertising neighboring devices, acting as a Generic Attribute Profile (GATT) server.Once a connection was established between the on-board Bluetooth module, and the one on the Raspberry Pi, a private Transparent UART GATT service was used to serially transfer data from one device to another.In particular, the sensor panel was configured through the user interface (type of measurement, channels to be measured, sampling time interval).Next, the start of the measurements was requested on the GUI.The sensor OCPs were continuously acquired, processed, and plotted in real-time on the user interface, with three concurrent threads.A default sampling interval of five samples per second was used for this multi-ion-sensing task.For each 30 samples acquired, the OCP signals were averaged on that time window, and the ion activity of the four target ions was predicted through the M-SVR model.The numerical results were updated on the GUI.The screenshot of the smartphone at the end of the experiment is displayed in Fig. 14.The potential peaks in the sensor responses highlight the increase of electrolyte activity at each time stamp of 2 min.
In a post-processing phase, the continuous sensor responses were fed to different multivariate calibration models in order to compare their prediction accuracy with the proposed M-SVR model.The results are shown in Fig. 15.The beforehand sensor calibration was used to estimate ion activity for MLR, while the non-linear regressors were trained with the experimental dataset presented in Section IV-C.We observe that for all models, the prediction accuracy worsens in time.This is due to ion interference that is more severe with the addition of electrolytes throughout the experiment.In particular, calcium-ISE exhibits a steadily increasing OCP.An online re-calibration could be implemented when the prediction error exceeds a threshold value, or for instance when a sensor response starts drifting.Nevertheless, ion  activity prediction is more accurate with non-linear regressors.Namely, an average accuracy improvement of 18.99, 27.73, and 35.49% was achieved with single-output SVRs, the proposed M-SVR, and an MLP model, respectively, compared to a bare MLR model.An MLP model has a slightly better prediction accuracy than the proposed M-SVR, but at expense of a higher computation complexity, as previously mentioned.Moreover, the multivariate ion activity prediction latency was computed.The tasks included the column-averaging of the last 30 samples acquired, the standardization of the input vector with the parameters taken from the training dataset, and the inference of the trained regressor.Latency of 18.34 ± 4.74 μs, 39.07 ± 1.8 μs, 22.68 ± 1.73 μs, and 3.89 ± 1.33 ms were obtained with MLR, single-output SVRs, M-SVR, and MLP model, respectively.Therefore, the proposed M-SVR model is suitable for real-time multi-ion-sensing applications, providing a low-latency and a meliorated ion activity prediction accuracy compared to a simple linear model.

V. CONCLUSION
We presented a novel framework enabling an accurate, continuous, and real-time multi-ion-monitoring, suitable for physiology and healthcare applications.The proposed system includes an ion-sensor array, a battery-powered and portable multi-channel readout front-end, and a multivariate calibration model deployed on a Raspberry Pi.The sensing interface featured Nernstian sensitivity and sensor lower LOD comparable to a bulky laboratory potentiometer, for the determination of sodium, potassium, ammonium, and calcium ions in artificial sweat samples.A temperature readout circuit was added, exhibiting an excellent linearity, and a sensitivity of 6.56 mV/ • C. The readout front-end supports 54 h battery lifetime, largely sufficient for continuous measurements.Besides, ion interference that is significantly distorting sensor response, was compensated by a non-linear M-SVR.It is shown that the multivariate calibration model is an accurate, compact, low-complexity, and unbiased estimator for sodium and potassium ions sensing, with global NRMSE and MRE improvement of 6.97%, and 10.26%, with respect to a traditional MLR.The different blocks were co-integrated to form an electronic tongue system that was evaluated in a real-time multi-ion-monitoring scenario, where the activity of the target electrolytes were steadily increased during continuous ion-monitoring.It results that the sensing front-end and the embedded M-SVR achieved an accurate tracking of the four target ion activity, with an average accuracy improvement of 27.73% with respect to a simple MLR, and with a latency of 22.68 ± 1.73 μs.Future works will consider the integration of the proposed front-end interface with fully-integrated sensing platforms, paving the way for real-time and accurate multi-ionmonitoring for wearable physiology.

Fig. 1 .
Fig. 1.Real-time and continuous multi-ion-monitoring of electrolytes in artificial sweat samples, where a multivariate calibration model is deployed on an edge device.

Fig. 4 .
Fig. 4. Analog front-end interface including a four-channel potentiometric readout circuitry and a resistance-to-voltage converter for temperature measurement.

Fig. 5 .
Fig. 5. Readout circuits for ion-sensing and temperature measurement.(a) Potentiometric readout circuit.(b) Second-order Sallen-Key low-pass filter.(c) Resistance-to-voltage converter where the RTD is polarized by an improved Howland current source.

Fig. 6 .
Fig. 6.Four-level factor combinations used for the design of the synthetic training set consisting of 128 samples.

Fig. 8 .
Fig. 8. (a) Sodium-ISE calibration in artificial sweat performed with the proposed hardware front-end, and (b) with an EMF6 Lawson Labs potentiometer.The time traces acquired during measurements are displayed in the top left insight.

Fig. 10 .
Fig.10.Experimental synthetic datasets acquired to train, optimize, and evaluate the multivariate calibration models.

Fig. 11 .
Fig. 11.Heatmaps of grid-search on hyper-parameters C and γ for the optimization of polynomial and Gaussian RBF M-SVRs.The optimal hyperparameters are the ones yielding the lowest Total_NRMSE.

Fig. 12 .Fig. 13 .
Fig.12.Scatter plot of target log a X vs predicted log a X for Na + , K + , NH + 4 , and Ca 2+ ISEs (32 test samples).The linear fit and its 95% confidence interval are plotted, where R 2 is the coefficient of determination.The red plot is the 1:1 line.

Fig. 14 .
Fig. 14.Screenshot of the smartphone serving as display terminal for the GUI executed on the Raspberry Pi.

Fig. 15 .
Fig. 15.Prediction accuracy achieved by multivariate calibration models during the real-time multi-ion-monitoring task.

TABLE II ISM
COMPOSITIONS FOR 100 MG MIXTURE

TABLE III OA
16(4 5 ) a subset of independent artificial sweat electrolyte compositions, leveraging the orthogonal array OA 16(4 5) shown in Table III.The five factors C0 − C4 represent the five constituents, sodium, potassium, ammonium, calcium, and magnesium ions.

TABLE V ACTIVITY
OF THE CONSTITUTING IONS EMULATING REAL-TIME MULTI-ION-MONITORINGincrease of the activity of the five constituting ions.The initial sample consisted of the five electrolytes at their nominal activity in sweat.Then, sodium, potassium, ammonium, calcium, and magnesium ions were added successively in the sample, every 2 min.The activity of the ions over the experiment are reported in TableV.Such experimental design enables a quantitative assessment of the accuracy of the M-SVR model deployed on the edge device.

TABLE VI CALIBRATION
OF SODIUM, POTASSIUM, AMMONIUM, AND CALCIUM IONS SOLID-CONTACT ISES IN WATER AND ARTIFICIAL SWEAT

TABLE VIII METRICS
OBTAINED DURING TRAINING AND EVALUATION OF A

TABLE X HARDWARE
AND SOFTWARE INTERFACES PROPOSED FOR MULTI-ION-MONITORING1 Analog front-end.2Feed-forwardneural network.