Privacy-Preserving Statistical Data Generation: Application to Sepsis Detection
Eric Macias-Fassio Aythami Morales Cristina Pruenza Julian Fierrez




Privacy-Preserving Statistical Data Generation





E. Macias-Fassio et al.



Instituto de Ingeniería del Conocimiento, Madrid, Spain

mail{eric.macias, cristina.pruenza}@iic.uam.es BiDA-Lab, Universidad Autónoma de Madrid, 28049, Madrid, Spain

{aythami.morales, julian.fierrez}@uam.es



Privacy-Preserving Statistical Data Generation: Application to Sepsis DetectionSupported by organization Instituto de Ingeniería del Conocimiento, Hospital Universitario Son Llátzer, the Fundación Instituto de Investigación Sanitaria Illes Balears (Spain) and BBforTAI (PID2021-127641OB-I00 MICINN/FEDER).
    Eric Macias-Fassio1,20009-0004-8275-5294 Aythami Morales20000-0002-7268-4785 Cristina Pruenza10009-0002-8565-4507 Julian Fierrez20000-0002-6343-5656 
    
=================================================================================================================================================================================================================================================================================================================






The biomedical field is among the sectors most impacted by the increasing regulation of Artificial Intelligence (AI) and data protection legislation, given the sensitivity of patient information. However, the rise of synthetic data generation methods offers a promising opportunity for data-driven technologies. In this study, we propose a statistical approach for synthetic data generation applicable in classification problems. We assess the utility and privacy implications of synthetic data generated by Kernel Density Estimator and K-Nearest Neighbors sampling (KDE-KNN) within a real-world context, specifically focusing on its application in sepsis detection. The detection of sepsis is a critical challenge in clinical practice due to its rapid progression and potentially life-threatening consequences. Moreover, we emphasize the benefits of KDE-KNN compared to current synthetic data generation methodologies. Additionally, our study examines the effects of incorporating synthetic data into model training procedures. This investigation provides valuable insights into the effectiveness of synthetic data generation techniques in mitigating regulatory constraints within the biomedical field.








§ INTRODUCTION






The exponential growth of Artificial Intelligence (AI) has sparked a revolutionary wave across various sectors with its profound impact particularly evident in the biomedical field. AI's ability to analyze vast amounts of data quickly and accurately has transformed medical research, diagnosis, and treatment. In recent years, there has been significant progress in the application of machine learning (ML) and deep learning models for early disease diagnosis <cit.>. These methodologies have exhibited substantial potential in identifying a diverse range of medical conditions, including cancer <cit.>, cardiovascular disease <cit.>, and Parkinson's disease <cit.>. Through sophisticated algorithms and analysis of extensive datasets, these models can potentially identify subtle patterns and markers indicative of these conditions at their early stages.

However, many governments are introducing strict regulations for personal data processing and AI applications such as new European Union AI act [<https://artificialintelligenceact.eu/>], CCPA[<https://oag.ca.gov/privacy/ccpa>] (Unitated States), and LGPD[<https://iapp.org/resources/article/brazilian-data-protection-law-lgpd-english-translation/>] (Brazil), which enforces data protection measures. A significant development in the regulatory landscape of AI has occurred with the enactment of the AI Act within the European Union. This legislative framework is designed to oversee and govern the application of AI models. In the realm of biomedical research, cautious consideration must be exercised when employing patient data for the training of AI models. Patient data, characterized by its sensitive nature, is subject to stringent protection under data protection laws, necessitating the preservation of privacy.

A solution that can potentially overcome these limitations involves the generation of fully synthetic data (SD) as an alternative to real data. SD is artificial data generated by a trained model and built to replicate real data by taking into account its distribution (mean, variance) and structure (e.g. correlation between attributes) <cit.>. The utilization of SD generation emerges as a versatile methodology in machine learning, extending its applications across two domains: augmenting datasets to enhance model training <cit.> and safeguarding the privacy of sensitive information <cit.>. 
Henceforth, this study introduces a straightforward technique for SD generation and conducts a comparative evaluation against state-of-the-art methodologies in terms of both utility and privacy considerations. The evaluation of these methods is performed within the context of a real-world application, specifically the early diagnosis of sepsis.

In more detail, the main contributions of this work are the following: 


    
  * We propose KDE-KNN, a statistical method to generate synthetic data for training and evaluating supervised learning algorithms. 
    
  * We evaluated the utility and privacy of the generated synthetic data using different supervised algorithms in the context of sepsis detection. Our findings demonstrate that KDE-KNN outperforms existing methods in generating synthetic tabular data for sepsis detection.
    
  * We assessed the generalization capacity of KDE-KNN using two real databases with more than 2000 patients. Our results suggest that KDE-KNN has certain advantages in terms of generalization over other methods.





§ RELATED WORKS




We have divided this section in two parts: (i) synthetic tabular data generation approaches in Healthcare, and (ii) machine learning models for predicting sepsis.



 §.§ Synthetic tabular data generation approaches in Healthcare

Synthetic data (SD) was first proposed and defined by Rubin <cit.> and Little <cit.> in 1993 as datasets consisting of records of individual synthetic values instead of real values. Nowadays, the concept of SD has evolved to encompass artificial data generated by trained models, designed to emulate real data by faithfully capturing its distributional (such as mean and variance) and structural attributes (including correlations between attributes) <cit.>.
SD generation stands out as a highly promising yet largely underexploited technology for fulfilling privacy-preserving laws. In the biomedical sector, synthetic data generation has been mainly investigated in medical imaging <cit.>,  electronic health records (EHR) free-text content <cit.> and EHR tabular data <cit.>. 

This study focused on synthetic EHR tabular data generation, as it is the predominant type of data used to develop ML models to aid health care decision-making <cit.>. 

Tabular healthcare-related data stored in EHR contain vast and diverse amounts of patient-related data. Typically, each row in a healthcare tabular dataset represents a single data record containing descriptive patient details such as date of birth, gender, and demographic information, along with sensitive attributes primarily consisting of longitudinal data. This longitudinal data comprises a series of medical events occurring at various time points, encompassing diagnoses, laboratory test results, and prescription information <cit.>.

In the healthcare context, numerous approaches to generating synthetic data can be found in the literature. Among these, one widely utilized algorithm is the Synthetic Minority Oversampling Technique (SMOTE) <cit.>, representing a straightforward method for generating synthetic tabular data <cit.>. This algorithm operates by synthesizing new data through interpolation of the existing samples. 
Another statistical approach to generate synthetic data involves Kernel Density Estimation (KDE) based models. Our framework for synthetic data generation in the healthcare context relies on KDE, chosen for its non-parametric nature and demonstrated efficacy, particularly in small datasets, which are prevalent in the biomedical field <cit.>.

Gaussian Multivariate (GM) <cit.>, Bayesian Networks <cit.>, Categorical maximum entropy model <cit.>, and Movement-based kernel density estimation <cit.>. These approaches employ a statistical model to learn the multivariate distributions of the RD to sample a set of STD. They are typically used for small amounts of data <cit.>. 

quizás quitar lo anterior (de .bib tmb) y hablar directamente de SMOTE 

Additional methodologies used for SD generation involves the utilization of generative models, which include generative adversarial networks (GANs) and diffusion models (DM).

Since their inception in 2014 <cit.>, GANs have demonstrated exceptional capability in the production of synthetic image data <cit.>. For this reason, the application of GANs to other  data types, such as tabular data, is a popular topic in the AI research community <cit.>. Some GAN-based synthetic tabular data generation approaches in Healthcare are ehrGAN <cit.>, medGAN <cit.>, GcGAN <cit.>. However, owing to the difficulties associated with training these models, as well as constraints related to sample size, we opt not to evaluate such models in this study.

On the other hand, we have diffusion models (DM). DM represent another class of generative models which have been widely used in the computer vision field. Notably, recent advancements have led to the development of architectures tailored to exploit diffusion models for tabular data, such as TabDDPM <cit.>, which has demonstrated significant potential and promising outcomes in this regard. For these reasons, in this study we have evaluated the performance between SMOTE, TabDDPM and KDE-based generative models.



 §.§ Machine learning models for predicting sepsis

Sepsis is defined as life-threatening organ dysfunction caused by a dysregulated host response to infection <cit.>. In 2017, approximately 20% of all global deaths were attributed to sepsis <cit.>. Early diagnosis of sepsis is crucial in the clinical setting, as it could help to significantly improve patient outcomes <cit.>, but early and accurate sepsis detection is still a challenging clinical problem <cit.>. For this reason, several ML algorithms have been designed to predict sepsis using retrospective data <cit.>. To our current knowledge, existing algorithms for sepsis prediction operate within a defined temporal window, typically forecasting the likelihood of sepsis onset within a specific time lapse, such as the next 24 hours. In our study, we want to overcome temporal constraints by seeking to predict the presence or absence of sepsis without temporal limitations. Therefore, we frame the task of sepsis detection as a classification problem, with the aim of addressing the question: Will patient A develop sepsis in the future? Furthermore, we substantiate our findings through validation in an external cohort for robustness and generalizability.



§ MATERIALS METHODS




In this study we have used 2 databases: i) Mannheim database (MaDB) used for training our models and build the synthetic datasets; ii) Son Llàtzer hospital database (SLDB) used as external validating dataset to evaluate the trained models. 




 §.§ Mannheim database

We used the University Medical Centre Mannheim database of patients admitted to intensive care unit (ICU) <cit.>. This database contains a total of 1275 patients, 979 with non-sepsis and 296 with sepsis. Initially, the MaDB comprised 42 timelines of features and the diagnosis of sepsis at each time step. However, for comparative analysis with the SLDB, it was necessary to align the feature sets. Consequently, only 27 features were found to be common between both databases. Among this features we have the age of the patient and lab results (Table <ref>).

For our study we did not use temporal data, instead we set a cut-off value at 9 hours as we estimated that in this time period all clinical tests could be performed and laboratory results could be collected. If a test has been performed several times during this period, the last value is used. In this way we constructed a dataset where our predictor variables were collected in that time interval and the objective was to predict whether a patient will develop sepsis in the future (classification problem), regardless of the time lapse window. 

The Mannheim database (MaDB), contains temporal data that allow precise tracking of sepsis onset times for patients, as evidenced in Table <ref>. The notable variability in the timing of sepsis manifestation within this dataset underscores its inherent heterogeneity. However, we do not use this temporal information, because we treat the detection of sepsis as a classification problem, knowing that this is a more challenging problem to solve. The MaDB has been used to train and test models and generate synthetic data.












 §.§ Son Llátzer hospital database

We used a database from Son Llàtzer Hospital of patients admitted to emergency and ICU. The SLDB contains 2028 patients in total, 1014 with non-sepsis and 1014 with sepsis. In this database, we also selected the 27 common features with the MaDB. However, within the SLDB, the precise mean sepsis onset time remains unknown. According to insights from the medical team, the mean sepsis onset time is estimated to range between 24 to 48 hours. 
We employed this database for external validation, acknowledging significant disparities in sepsis onset times compared to our primary dataset. Notably, there are substantial variations in data distribution between the two databases. Thus, we perceived this as an opportunity to assess the generalization capacity of our models across diverse demographic populations.



 §.§ Sepsis Prediction Models


Predicting sepsis onset remains a critical challenge in clinical practice due to its rapid progression and potentially life-threatening consequences <cit.>. Early detection and intervention are paramount for improving patient outcomes and reducing mortality rates associated with this severe condition. Consequently, our study undertook an evaluation of three distinct ML models and assessed their performance based on the Area Under the Curve (AUC) score.


    
  * Random Forest (RF) <cit.>: RF is a widely used machine learning algorithm that belongs to the ensemble learning family, characterized by the construction of multiple decision trees during training. For classification tasks, RF outputs the predicted class, which in the context of sepsis prediction signifies whether a patient is likely to develop sepsis or not. 
    
  * Support Vector Machine (SVM) <cit.>: SVM is a machine learning algorithm used for classification tasks. Unlike traditional classifiers that aim to find a decision boundary that separates classes, SVM seeks to find the hyperplane that best divides the classes while maximizing the margin between them. In our experiments we have used two SVM changing the type of kernel: i) SVM with a linear kernel; ii) SVM with a radial basis function (rbf) kernel.
    
  * The hyperparameters of the models were tuned using the Optuna library <cit.>. Specifically, we employed a TPE (Tree-structured Parzen Estimator) sampler with 40 trials to maximize AUC. For the Random Forest (RF) model, the optimal hyperparameters were determined as follows: bootstrap was set to False, max_depth to 20, max_features to 5, min_samples_leaf to 5, min_samples_split to 12, and n_estimators to 500. As for the SVM models, both of them had C set to 1. Other parameters that were not mentioned stay by default according to scikit-learn library <cit.>.


       









 §.§ Statistical Data Modelling Approaches


In this paper we have analysed 3 popular statistical data modelling methods:

SMOTE <cit.>: SMOTE is an oversampling methodology that was initially employed to generate synthetic observations exclusively from the minority class. However, we expanded this approach to incorporate the majority class as well <cit.>, resulting in the creation of a fully synthetic dataset.


The algorithm works as follows. In the proposed method, the generation of synthetic data points begins with selecting a data point from a specific class and its nearest neighbor belonging to the same class. The distance between these two points is calculated as the dissimilarity between their feature vectors. This distance metric, derived from the difference between the feature vectors of the data points, is then modulated by a random number between 0 and 1. This scaled distance is subsequently added to the original data point, effectively positioning the new sample along the line segment connecting the original point to its neighbor. Iterating this process yields additional synthetic samples until the desired quantity is attained. 


TabDDPM <cit.>: TabDDPM is a design of denoising diffusion probabilistic models for tabular data. To tackle mixed-type characteristics of tabular data, this architecture integrates gaussian diffusion for capturing the characteristics of continuous features and multinomial diffusion for effectively modeling categorical attributes.

KDE <cit.>: Kernel Density Estimation (KDE) was proposed by Rosenblatt <cit.> and Parzen <cit.>. KDE is a method used to estimate probability density functions. By constructing this distribution, we gain the ability to generate synthetic data samples through sampling. This capability allows for the creation of synthetic datasets representative of the underlying probability distribution. We conducted experiments using the multivariate KDE. In the multivariate KDE technique, we constructed distributions jointly, taking into account the interdependencies between features. This allowed us to capture complex relationships and dependencies across multiple variables simultaneously.



 §.§ KDE-KNN: Privacy Preserving Synthetic Clinical Data


Our proposed methodology is founded on the integration of KDE and K-Nearest Neighbors (KNN) model. The idea is to use a multivariate gaussian KDE to approximate the probability density function of the original dataset features and then sample from it to generate synthetic datasets. However, as the feature space can be very large, we train a KNN to validate the synthetic samples. The procedural steps undertaken to construct our synthetic dataset are the following:


    
  * Training a KNN model: A K-Nearest Neighbors (KNN) model was trained using the provided training dataset.
    
  * Data preparation for KDE: The training dataset was partitioned into two distinct groups: patients with sepsis (18.55%) and patients without sepsis (81.45%).
    
  * Multivariate KDE construction: Statistical independent multivariate KDE distributions were trained for each subgroup.
    
  * Sampling synthetic data: Sampling was performed from each multivariate KDE model, generating 540 synthetic patients with sepsis and 540 synthetic patients without sepsis.
    
  * Validation using KNN model: Validation of the synthetic samples was conducted by the trained KNN model. Synthetic data originated from the KDE model built with non-sepsis data should be classified as non-sepsis by the KNN model. Any discrepancies lead to the discarding of the data point.

 
 Steps 4 and 5 were iteratively executed until we attained a total of 540 synthetic data points for patients with sepsis and 540 synthetic data points for patients without sepsis. This process ensures the creation of a balanced synthetic dataset representative of both septic and non-septic patient populations.

For clarification, we closed this section by visualizing our proposed synthetic method as a flowchart, illustrated in Fig. <ref>. 




    
To generate the synthetic dataset with the univariate KDE we first split the training data into two subsets, as before: patients diagnosed with sepsis and those without. Subsequently, we construct separate probability distributions for each feature within these subsets using a Gaussian kernel. For instance, considering the temperature, distinct distributions are formed based on the data from patients with sepsis and those without sepsis. In total we have 27 features, so we get 27 × 2 (sepsis/non-sepsis) distributions. To generate synthetic data for patients with sepsis, we sample from the distributions derived from patients diagnosed with sepsis. Conversely, for generating synthetic data for patients without sepsis, we utilize the distributions obtained from the non-septic patient cohort.










§ EXPERIMENTS AND RESULTS

In this section, we assess the influence of synthetic data on the performance of sepsis detection models.


 §.§ Experimental Protocol


Initially, our study is based on two distinct sepsis databases: the MaDB and the SLDB. The MaDB served as the primary dataset for model training/testing and synthetic data generation, while the SLDB was exclusively utilized for external validation purposes. 

Our first experimental phase involved evaluating model performance using real data exclusively. To accomplish this, we employed the MaDB and we partitioned the data into training (85%) and testing (15%) sets, repeating the experiment three times while changing the seed. Additionally, each partition underwent an external validation using the SLDB. Notably, our analysis revealed that the performance of the most effective models remained consistent across different partitions, suggesting minimal impact of partitioning on model performance. 

The second phase of experimentation was dedicated to assessing the utility of synthetic data. Our focus was on evaluating model performance exclusively using synthetic data. To achieve this, we generated a fully synthetic balanced dataset comprising 540 samples with sepsis and an equal number of 540 samples without sepsis. This balanced dataset mirrored the size of our original imbalanced training set. Building upon the stability observed in model performance across the three partitions in Experiment 1, one of the partitions was randomly selected for this subsequent analysis. This selection yielded both a training set and a test set sourced from the MaDB. The training set acted as a seed for generating synthetic data, employing the methodologies outlined in Section 3.4. For each method, three distinct synthetic balanced datasets were generated.
Following this, the quality of the synthetic data was evaluated using the test set. Additionally, an external validation was conducted using the SLDB to ensure the reliability and validity of our findings. The results of this experiment showed that the best method to generate synthetic data in the context of sepsis prediction is KDE-KNN. Finally, in the experiment 3, we examined how the incorporation of both real and synthetic data in the training set influenced model performance.

The third phase of our experimentation aimed to assess data privacy preservation using KDE-KNN method. In the experiment 4, we investigated the proximity of synthetic data to real data using the Mean Distance to Closest Record (DCR) metric <cit.>. Mean DCR calculates the average distance between synthetic samples and their closest real data points.




 §.§ Real Data and Synthetic Data Utility


The findings from Experiment 1 are presented in Table <ref>. This experiment involved evaluating model performance in terms of AUC using exclusively real data. The results indicated that the RF model demonstrated superior performance in the test set. Nevertheless, concerning generalization, the results indicated a
a lower performance of the RF model, while the SVM with the rbf kernel demonstrated better generalization capabilities.



Experiment 2 aimed to assess the utility of synthetic data. The outcomes of Experiment 2 are detailed in Table <ref>. This experiment involved evaluating model performance using balanced synthetic datasets. 

The findings indicated a notable enhancement in model performance when employing balanced synthetic datasets. Remarkably, balanced synthetic data appeared to outperform real imbalanced data. Specifically, the SVM model with the rbf kernel demonstrated superior performance when trained on synthetic data generated using the KDE-KNN method. Furthermore, enhanced model performance was evident in the external validation database. These results may be due to the reduced heterogeneity of the external database and the earlier onset of sepsis in patients, suggesting that our models perform better when sepsis occurs within the 24-48 hour timeframe. Additionally, we aim to emphasize the minimal variance observed in synthetic datasets generated through our method. 


In Experiment 3, our goal was to examine how the combination of real and synthetic data during training affects model performance. The findings from Experiment 3 are presented in Table <ref>. For this analysis, we selected the best model and the best synthetic method from Experiment 2, which were identified as the SVM model with an rbf kernel and KDE-KNN as the synthetic method. We proceeded to train the SVM model using varying proportions of real and synthetic data generated by KDE-KNN, as illustrated in Table <ref>. Experiments combining real and synthetic data were performed 3 times using different seeds to sample the data. The findings indicated that augmenting the percentage of synthetic data generated with KDE-KNN in the training set leads to an improvement in the model performance, attributable to the enhanced balance of the dataset. The Fig. <ref> shows the normalized distributions of 4 features in the real and synthetic databases. Note that the differences between both real databases are significant, and how the distribution of the synthetic samples tend to be realistic.   













 §.§ Privacy preservation result




In Experiment 4, we conducted an analysis of the mean Distance to Closest Record (DCR) <cit.> between synthetic samples and their nearest real data points. The DCR is calculated as the Euclidean distance between a real sample and the closest synthetic sample. Low DCR values suggest that synthetic samples closely resemble real data points, potentially compromising privacy requirements. Conversely, higher DCR values indicate that the generative model can produce novel records rather than mere replicas of existing data. It is important to note that out-of-distribution data, such as random noise, can also yield high DCR values. Therefore, DCR must be evaluated alongside machine learning efficiency considerations <cit.>. The Fig. <ref> illustrates the compromise between privacy-preserving generation and realism of the synthetic samples. 






The Fig. <ref> presents the probability distributions of DCR for the real samples (d_R-R) and the 3 generation approaches evaluated in previous experiments (d_R-S). For SMOTE, the mean DCR value was 0.989, while for KDE-KNN and TabDDPM, the values were 4.971 and 7.463 respectively. Comparing these results with the mean distance between real data, which was 2.715, we observe that both TabDDPM and KDE-KNN demonstrate efficacy in generating synthetic data that preserves privacy, exhibiting superior performance compared to SMOTE.

















§ CONCLUSIONS

Motivated by the imperative of adhering to data privacy regulations, we introduce KDE-KNN, a statistical method for generating tabular synthetic data. Through an extensive evaluation within the context of sepsis detection, we assessed this method in terms of both utility and privacy. Remarkably, our findings suggested that synthetic data outperformed real data in sepsis detection. We attributed this phenomenon to the fact that real dataset was quite imbalanced while synthetic dataset was balanced. For this reason,  KDE-KNN, also would be a good method to balance datasets. Moreover, our findings have been corroborated through validation in an external database, reinforcing the  generalizability potential of our synthesis approach.
Additionally, our results affirmed the efficacy of KDE-KNN in preserving privacy, as evidenced by the distance observed between synthetic and real data points. In conclusion, KDE-KNN emerges as a promising method for not only enhancing dataset utility but also safeguarding data privacy, making it a valuable tool in various data-driven applications.























































This is a sample theorem. The run-in heading is set in bold, while
the following text appears in italics. Definitions, lemmas,
propositions, and corollaries are styled the same way.






Proofs, examples, and remarks have the initial word in italics,
while the following text appears in normal font.

For citations of references, we prefer the use of square brackets
and consecutive numbers. Citations using labels or the author/year
convention are also acceptable. The following bibliography provides
a sample reference list with entries for journal
articles <cit.>, an LNCS chapter <cit.>, a
book <cit.>, proceedings without editors <cit.>,
and a homepage <cit.>. Multiple citations are grouped
<cit.>,
<cit.>.



  §.§.§ Acknowledgements
 Please place your acknowledgments at
the end of the paper, preceded by an unnumbered run-in heading (i.e.
3rd-level heading).


splncs04













8
ref_article1
Author, F.: Article title. Journal 2(5), 99–110 (2016)

ref_lncs1
Author, F., Author, S.: Title of a proceedings paper. In: Editor,
F., Editor, S. (eds.) CONFERENCE 2016, LNCS, vol. 9999, pp. 1–13.
Springer, Heidelberg (2016). 10.10007/1234567890

ref_book1
Author, F., Author, S., Author, T.: Book title. 2nd edn. Publisher,
Location (1999)

ref_proc1
Author, A.-B.: Contribution title. In: 9th International Proceedings
on Proceedings, pp. 1–2. Publisher, Location (2010)

ref_url1
LNCS Homepage, <http://www.springer.com/lncs>. Last accessed 4
Oct 2017




