Automated De-Identification of A rabic Medical Records (2023)

Abstract: As Electronic Health Records (EHR) become ubiquitous in healthcare systems worldwide, including in Arabic-speaking countries, the dual imperative of safeguarding patient privacy and leveraging data for research and quality improvement grows. This paper presents a first-of-its-kind automated de-identification pipeline for medical text specifically tailored for the Arabic language. This includes accurate medical Named Entity Recognition (NER) for identifying personal information; data obfuscation models to replace sensitive entities with fake entities; and an implementation that natively scales to large datasets on commodity clusters. This research makes two contributions. First, we adapt two existing NER architectures— BERT For Token Classification (BFTC) and BiLSTM-CNN-Char – to accommodate the unique syntactic and morphological characteristics of the Arabic language. Comparative analysis suggests that BFTC models outperform Bi-LSTM models, achieving higher F1 scores for both identifying and redacting personally identifiable information (PII) from Arabic medical texts. Second, we augment the deep learning models with a contextual parser engine to handle commonly missed entities. Experiments show that the combined pipeline demonstrates superior performance with micro F1 scores ranging from 0.94 to 0.98 on the test dataset, which is a translated version of the i2b2 2014 de-identification challenge, across 17 sensitive entities. This level of accuracy is in line with that achieved with manual de-identification by domain experts, suggesting that a fully automated and scalable process is now viable.

## introduction arabic is one major language that covers a large geographic and demographic portion of the world population with a high ehr adoption rate @xcite . this means there is a high volume of both structured and unstructured digital data available that can be leveraged for different use cases. however, the data needs to be de-identified before being used for any research or development purpose. de-identification of unstructured documents poses challenges due to various types of noise. furthermore, every language has its own lexical rules, which makes it challenging to have a single model that can perform well across multiple languages. therefore, there is a need to have models trained for different languages to get the best results. usually, named entity recognition (ner) models are used to extract sensitive information from the text which can then be de-identified @xcite . however, training ner models require labeled datasets, which are scarce and laborious to produce. in particular, the arabic language has an extremely limited number of public datasets that can be leveraged. the principal aim of this study is fourfold: firstly, we introduce the first-of-its-kind medical named entity recognition (ner) and deidentification models tailored specifically for the arabic language, addressing a critical gap in the field. secondly, we adapt existing ner architectures-bilstm-cnn-char and bert for token classification (bftc)-to meet the unique syntactic and morphological requirements of the arabic language. thirdly, we implement a novel approach to overcome dataset limitations by translating a standard english dataset used in the 2014 i2b2 de-identification challenge to arabic using an entity-preservation technique. fourthly, we employ a contextual parser engine to supplement weak entity extractions, thereby increasing the robustness of our models. to train, evaluate, and compare these ner models, we use the spark nlp for healthcare library @xcite , which offers both comprehensive ner support @xcite and token embedding models for the arabic language. importantly, this is not purely academic research; it's an applied study that has been engineered to be fully compatible and scalable with apache spark, making it immediately deployable in large-scale healthcare systems. ## related work the concept of automatic de-identification was first introduced into the informatics for integrating biology and the bedside (i2b2) project as explained by @xcite and then expanded by @xcite , as an academic nlp challenge on automatically detecting phi identifiers from medical records. these challenges have boosted research and development of machine & deep learning algorithms for robust phi identification. since then, there have been numerous studies to expand automatic de-identification to multiple languages. @xcite generated a dataset, and trained ner models for medical texts in spanish language. @xcite applied similar techniques to italian covid-19 documents for de-identification. over the years, researchers have proposed multiple architectures aiming to achieve better performance. initial approaches relied on hand-crafted features and lexical rules to extract required concepts from data. however, as token embedding models @xcite advanced, other architectures started leveraging these embedding models. among these, bi-lstm and conditional random fields (crf) based models @xcite became notable for ner. more recently, attention-based models have been showing significantly better performance for sequence labeling tasks @xcite . regarding other efforts towards extracting medical terms from arabic medical texts, several noteworthy studies have been conducted. @xcite explored deep learning techniques, including lstm-crf and bilstm-crf models, for disease entity recognition in arabic medical texts, achieving impressive precision, recall, and f1-scores. @xcite introduced bayesian belief networks (bbn) as an innovative approach to extracting various medical entities, demonstrating promising precision and recall for diseases and treatment methods. in addition, @xcite tackled the challenges of implementing medical bots in arabic with the introduction of the maqa dataset, high-lighting the effectiveness of transformer models. @xcite fine-tuned neural networks for medical entity recognition in arabic medical texts, while @xcite presented a novel dataset for disease classification, emphasizing the potential of pre-trained models. finally, @xcite compared strategies for medical term extraction, revealing the advantages of using arabic equivalents of latin prefixes and suffixes. these studies collectively advance the field of ner and medical term extraction in arabic medical texts, offering a range of valuable approaches and insights. despite these advancements, it is crucial to note that there has been a notable absence of deidentification models or efforts explicitly targeting the arabic language. this gap in the literature underscores the importance and timeliness of our study, which aims to address this void by introducing the first arabic-specific medical ner and de-identification models. ## dataset construction and annotation training a named entity recognition model requires data to be annotated with named entities which is a laborious process. instead of manually annotating an arabic dataset, we took the standard 2014 i2b2 dataset (in english) @xcite and translated it to arabic using the google translate api foot_0 . the i2b2 dataset is in conll format, which means text is tokenized, and entities are identified using the iob2 tagging scheme foot_1 . since entities have fixed boundaries relative to the original text, translating the text naively would result in entity boundary mismatch. for example, the name and age in the text "alan is a 30 year old male" start at token 1 and 4, however, after translation, the name and age start at token 1 and 6 " ". this is because translation can change the entire structure of the text, consequently, making entity boundary mapping challenging. this problem is further exacerbated for entities spanning across multiple tokens as the number of tokens could also vary. to solve this problem, we replace entities in the original (english) text with their types. for example, "alan is a 30 year old male" would be converted to "name is a age year old male". this way when the text is translated, we can search for the entity types by simple string matching, and replace them with arabic values. for instance, "name" is replaced with an actual arabic name " ". in addition to solving the problem of preserving entity boundaries, this technique also helps to adapt the data to the new language, as entities, such as names, cities, addresses are native arabic values. the original i2b2 deid dataset provides two types of entity sets: generic and granular. the granular approach provides additional context that can be crucial for specific applications. for example, in a healthcare setting, knowing that a name refers to a "patient" rather than just a "name" could be highly useful. similarly, distinguishing between zip codes, cities, and countries can be very important in applications like location-based services or logistics. the generic approach is more broad and could be useful for general-purpose ner tasks where such granular distinctions are not necessary. it may also require less computational power and resources than the more detailed granular approach. here is a sample list of mapping between generic and granular set of entities: chunk generic granular 2000 16 date date name patient 789 location zip location city 54321 location zip location city location country location hospital name doctor name patient 35 age age on the other hand, the "granular" column takes entity recognition a step further by using more specific, detailed tags. ## experimentation & analysis two different ner architectures are trained and evaluated on a standard 80-20 split, and their performance is evaluated based on the model architecture and the embeddings used while training. the first model is based on a bi-lstm architecture as explained in @xcite . this bi-lstm model is versatile and can be paired with virtually any token embedding model. in our experiments, we use this architecture with glove @xcite and bert @xcite embeddings. the glove embeddings are trained on the arabic common crawl dataset foot_2 foot_3 . for arabic bert embeddings, we utilize models pre-trained on an arabic dataset; arabert @xcite , and camelbert @xcite . the second model architecture is based solely on bert, upon which we train end-to-end bert for token classification (bftc) models. in addition to the named entities in our training dataset, most documents contain certain rule-based entities like unique organizational/national identifiers. extracting such information does not necessarily require re-training the model, as most of these identifiers have a fixed format, and can be easily extracted using regular expressions. therefore, we include a regular expression engine in the final pipeline that is fully customizable as explained in section 4.1.3. figure 2 illustrates a complete end-to-end pipeline with all the components. ## conclusion in conclusion, this study successfully presents a groundbreaking advancement in healthcare data privacy and research for arabic-speaking communities by introducing the first medical named entity recognition (ner) and de-identification models tailored specifically for the arabic language. through the adaptation of existing architectures-bilstm-cnn-char and bert for token classification (bftc)-we were able to accommodate the unique linguistic features of arabic. furthermore, our novel entity-preservation technique was pivotal in overcoming the challenges associated with limited datasets, enabling the translation of a standard english dataset into arabic for training and evaluation. our comparative analyses demonstrated that bert for token classification models outperformed bi-lstm models, achieving higher f1 scores in both the identification and redaction of personally identifiable information (pii) in arabic medical texts. the contextual parser engine deployed in our study further enhanced the robustness of our models. significantly, this work is more than just an academic endeavor; it is an applied study with tools that are ready to be deployed at scale using apache spark. as a seminal contribution, this research not only provides essential tools for the safe and efficient handling of arabic medical records but also lays a foundation for future studies, opening up avenues for the adaptation of ner and deidentification techniques to other underrepresented languages.