{'fraction_non_alphanumeric': 0.033890812642746626, 'fraction_numerical': 0.011419730347012451, 'mean_word_length': 4.904306220095694, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
De-identification of Unstructured Clinical Texts from Sequence to Sequence Perspective

In this work, we propose a novel problem formulation for de-identification of unstructured clinical text. We formulate the de-identification problem as a sequence to sequence learning problem instead of a token classification problem. Our approach is inspired by the recent state-of -the-art performance of sequence to sequence learning models for named entity recognition. Early experimentation of our proposed approach achieved 98.91% recall rate on i2b2 dataset. This performance is comparable to current state-of-the-art models for unstructured clinical text de-identification.


INTRODUCTION
A recent study [17] found out that about 95% of the eligible hospitals and 62% of all office-based physicians used Electronic Health Records (EHR) systems. The EHR records contain patient information, history, medication prescription, vital signs, laboratory test results etc. Moreover, they contain unstructured notes from physicians regarding the patient which are rich sources of contextual medical information. Statistical analysis of EHR can lead to less error-prone medical diagnosis, healthcare cost reduction and better short term preventive care [7].
However, the analysis of EHR for various clinically significant statistical task is not straightforward. EHRs often contain sensitive identifying information regarding patients which are generally considered private. To be specific, the U.S. Health Insurance Portability and Accountability Act (HIPAA) requires 18 re-identifying categories of information to be sanitized from EHR before dissemination [14]. These categories are called personal health information (PHI) and include patients name, profession, unique identifying numbers such as social security number, driving license number or medical insurance number etc. HIPAA precludes researchers from performing analysis on large scale EHR repositories unless they are de-identified.
Using human annotators for de-identifying EHR is a costly process. One estimate by [6] reported a cost of $50/hour for human annotators who read around 20000 words per hour. At this rate, it will cost $250,000 to annotate a dataset that have 100 million words. Moreover, this EHR de-identification by human annotation is also error prone. Prior work [13] reported that recall value varied between 63-94% for 13 human annotators when they were asked to de-identify approximately 130 patient notes. Therefore, it is likely that multiple human annotators will be required to annotate the same patient notes to ensure the quality of de-identified text. In that case, the cost of de-identification will increase even more.
The shortcomings of manual EHR de-identification process led to extensive research in the domain of automated EHR de-identification model. Before the widespread adoption of deep learning in natural language processing (NLP) tasks, majority of automated EHR deidentification systems adopted rule-based approach [6]. Rule-based approaches suffer from multiple shortcomings. Firstly, they are sensitive to dataset. Rules that work for one dataset may require extensive calibration for a different dataset. Secondly, rules fail to take context into account. Consequently, rule based approaches are not scalable and have poor performance generally. Supervised machine learning methods offered comparatively better performance and generalizability compared to rule-based methods. These models solve the de-identification problem as binary (PHI and non-PHI) or categorical (types of PHI) classification problem. The shortcoming of these systems is that they rely on handcrafted features which are extracted from the tokens or sentences. Deep learning solves this dependency by learning useful features from text data without any human intervention. Deep learning methods that use non-linear neural network models have shown state-of-the-art performance in natural language understanding tasks such as named entity recognition [11], part of speech tagging [8], neural machine translation [2] etc. All of these tasks have been solved by some form of recurrent neural network (RNN). In 2018, Google proposed BERT [5], a state-of-the art neural network architecture that set the benchmark for a range of NLP tasks. BERT used a new mechanism called "self-attention". The current state-of-the-art EHR de-identification model [1] also employs attention based approach to get improved results in benchmark datasets.
Motivation. During literature review, we noted that the earliest EHR de-identification model is dated back in 1996 which was called SCRUB [16]. Subsequent 25 years of academic research produced a large body of work for EHR de-identification. During this period, methods gradually progressed from rule based to deep learning models. Proliferation of benchmark datasets such as i2b2 [15], MIMIC-II [12] and MIMIC-III [9] also played a pivotal role in this development. Current state-of-the-art [1] achieves a recall rate (deidentification accuracy) of 98.41%, 82.9% and 100.0% respectively for these datasets. We observe that recall rate for the MIMIC-II dataset is particularly low. Therefore, we believe there is room for improvement in terms of model performance on benchmark datasets. Moreover, prior works modeled clinical text de-identification as a classification problem. We note that de-identification problem can be modeled differently as well (i.e., sequence to sequence modeling, metric learning). However, these approaches have not been explored in literature yet. Contribution. We model the de-identification problem as a sequence to sequence learning problem. Our approach is inspired by the recent advancement in named entity recognition in [3] which combined transfer learning and sequence to sequence modeling.
To the best of our knowledge, this is the first work that models deidentification problem as a sequence to sequence learning problem. The summary of our contributions are: • We propose a novel sequence-to-sequence learning based formulation of the unstructured clinical text de-identification problem. • Our proposed method achieves 98.91% recall for i2b2 dataset.

PROBLEM DEFINITION
The problem we tackle in this work is the unstructured clinical text de-identification problem. Let us consider a unstructured clinical text which consists of tokens { 1 , 2 , · · · , }. HIPAA identifies 18 types of PHI which are needed to be removed from EHR before public release. Each token ∈ either belongs to one of the classes of PHI or not.
Consider a function F . It takes as input and produces a sequence of tokens,ˆ= {ˆ1,ˆ2, · · · ,ˆ}. Equation 1 defines eacĥ ∈ˆ.ˆ= special is a special token to replace the PHI tokens. It can be same for all PHI classes or different for each PHI classes. The objective of the de-identification problem is to find the optimal F so that F ( ) =ˆresults in maximum precision and recall.

PROPOSED SOLUTION
We propose a encoder-decoder architecture for unstructured clinical text de-identification. This is the standard architecture in multiple natural language processing tasks such as named entity recognition [3], machine translation [2], etc. Both encoder and decoder consist of "multi head self-attention" layers. From the encoder perspective, the attention layers encode a variable length input sequence into a fixed length context vector. Similarly, from the decoder perspective, the attention layers decode a fixed length context vector to a variable length output sequence. During the training process, the model learns about the context and features of the PHI tokens. The decoder then maps the non-PHI tokens to their input and the PHI tokens to the special token. Figure 1(a) shows the problem formulations used in prior works. The de-identification model takes a sequence of tokens as input and output is a vector that contains the label for each token. 0 stands for non-PHI and 1 stands for PHI. On the other hand, Figure  1(b) shows our proposed solution model. The input is the same as prior works. The output is a sequence of tokens where the input PHI-tokens have been replaced with a special token REDACTED. This is a fundamental difference in our approach compared to the prior works. In prior approaches, the tokens were mapped to only two classes. In our approach, each token is mapped to itself if it is a non-PHI token. If it is a PHI token, then it is mapped to a special token. In other words, the output set of prior approaches are {0,1}. In our approach, the output set consists of all possible input tokens and the special tokens.
An important difference between our approach and the prior approaches is the model architecture. The current deep learning models for de-identification learn a task specific encoding before applying that encoding for token classification [1,4]. Therefore, current architectures are encoder-classifier models. On the contrary, our proposed architecture is an encoder-decoder model. The encoder model learns to encode unstructured clinical texts. The decoder model learns to replace the PHI tokens with special token. In other words, the decoder model translates the input sequence to a de-identified output sequence.
Let us explain this difference with an example. In Figure 1(a), the non PHI tokens {Doctor, Did, Not, Prescribe, Insulin, For, Mrs} are mapped to 0 and PHI tokens {Matthew, Edelson} are mapped to 1. Let's consider the example in Figure 1(b). We assume that each token in the input sequence is mapped to id 1-9 and the token REDACTED is mapped to id 10. In the output sequence, each non-PHI tokens are mapped to their own token ids while the PHI tokens are mapped to id 10. In other words, the input sequence "Doctor Matthew did not prescribe insulin for Mrs. Edelson" becomes {1,2,3,4,5,6,7,8,9} before being fed into encoder. The decoder produces {1,10,3,4,5,6,7,8,10} which is mapped back to "Doctor REDACTED did not prescribe insulin for Mrs. REDACTED".

PRELIMINARY RESULT
Implementation. We implemented the encoder-decoder model for sequence to sequence learning in python. We used Tensorflow 2.0 as implementation framework. Both encoder and decoder model consists of an embedding layer and 8 multi-head self-attention layers. We used "weighted softmax crossentropy" as loss function. ADAM optimizer was used for training optimization. We set the initial learning rate to 0.002.
We evaluate the performance of our proposed model based on recall value. Recall value represents how many of the PHI tokens have been replaced by the special tokens in the output sequences. We put higher emphasis on recall than precision 1 .
Experimental Result. We perform evaluation of our proposed model on the i2b2 2014 challenge task dataset. We present our result in Table 1. We achieved higher recall and F1-score than the current state-of-the-art (SOTA) model in literature. However, our precision score is slightly less than SOTA. We note that, the number of parameters in our model is comparatively lower than SOTA which may have played a role in this case. We aim to increase number of model parameters to achieve better precision in future iterations. We are currently performing experimentation on MIMIC-II and MIMIC-III datasets. The results from these experiments will be included in our future work.

FUTURE WORK
Experiment on MIMIC-II and III. We will perform experiment on MIMIC-II and III datasets. During literature review, we noted that current models have very low recall rate in MIMIC-II. We aim to improve that recall rate. Moreover, we plan to generate additional unstructured text data from MIMIC-II and III dataset and train our model on it to achieve greater robustness. Transfer Learning. We note that named entity recognition problem has similarity with unstructured clinical text de-identification. Literature review revealed that transfer learning improves the accuracy and generalizability of named entity recognition models. To the best of our knowledge transfer learning has not been leveraged for clinical text de-identification problem. We intend to explore this direction in our future works. Semi Supervised Learning. An important aspect of de-identification model training is the unavailability of ground truth data. Manual ground truth data annotation is an expensive and error-prone process. Semi-supervised learning can help to mitigate this challenge by training models on partially labeled dataset. Literature review of de-identification models reveal that semi-supervised learning have not been leveraged yet for clinical text de-identification. We will explore this training method for our models in our future works. Domain Adaptation. A common problem among current de-identification models is that domain shift issue. Models trained on one dataset generally perform very poorly on other datasets. Tzeng et al. showed that this issue can be mitigated by training in the models using adversarial domain adaptation [18]. We intend to explore this training approach in future iterations of this work.

CONCLUSION
In this work we presented a novel sequence-to-sequence problem formulation for the clinical text de-identification problem. We designed an encoder-decoder architecture to translated unstructured clinical texts with PHI tokens to sanitized clinical texts without the PHI tokens. Preliminary analysis of our proposed method shows promising evaluation metric scores. We are currently experimenting on other benchmark datasets to assess the effectiveness of our problem formulation and solution model.